<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>aragost Trifork ag</title>
	<atom:link href="http://www.aragost.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.aragost.com</link>
	<description>IT Systems &#38; Services</description>
	<lastBuildDate>Tue, 15 Nov 2011 11:24:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Meet us at GOTO Aarhus!</title>
		<link>http://www.aragost.com/2011/10/meet-us-at-goto-aarhus/</link>
		<comments>http://www.aragost.com/2011/10/meet-us-at-goto-aarhus/#comments</comments>
		<pubDate>Mon, 03 Oct 2011 07:42:39 +0000</pubDate>
		<dc:creator>Martin Geisler</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Mercurial]]></category>
		<category><![CDATA[Talk]]></category>

		<guid isPermaLink="false">http://www.aragost.com/?p=1018</guid>
		<description><![CDATA[We will organize a Mercurial user group event at the GOTO Aarhus 2011 conference next week. This is the abstract: Mercurial is an Open Source distributed version control system that offers you the power and speed to efficiently handle projects &#8230; <a href="http://www.aragost.com/2011/10/meet-us-at-goto-aarhus/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>We will organize a Mercurial user group event at the GOTO Aarhus 2011 conference next week. This is the abstract:</p>
<blockquote><p>Mercurial is an Open Source distributed version control system that offers you the power and speed to efficiently handle projects of any size and kind. Every clone contains the whole project history, so committing, branching, tagging and merging are local, fast and convenient. You can use a multitude of workflows and easily enhance its functionality with new or existing extensions. Come join us if you want to learn more!</p></blockquote>
<p>There will be two main parts:</p>
<ul>
<li><strong>Mercurial Kick Start:</strong> Martin Geisler will get you quickly up to speed on Mercurial. We will cover the important difference between centralized and distributed version control, and show the basic commands. The aim of the talk is to answer your questions about Mercurial, so we will try to make it very interactive.</li>
<li><strong>Mercurial Migration:</strong> Sune Foldager will describe how he helped migrate 150 developers from CVS to Mercurial. Why did they choose Mercurial over competing systems like Git? What changes did they make to their workflows and are they happy with the results?</li>
</ul>
<p>The speakers:</p>
<blockquote><p>Martin Geisler and Sune Foldager have both been involved in the Mercurial project since 2008 and are now part of the core developer team.</p>
<p>Martin moved from Denmark to Switzerland in the beginning of 2010 to work full-time as a Mercurial consultant for aragost Trifork. There he has helped several large European clients migrate to Mercurial by writing custom extensions, providing training, and helping with the implementation of new workflows.</p>
<p>Sune works in the infrastructure team for the Danish company Edlund A/S, with around 150 C# / .NET developers, and has been instrumental in switching their source control from CVS to Mercurial back in 2009. He has made several contributions to Mercurial concerning use and deployment in Windows environments, and working effectively with named branches.</p></blockquote>
<p><strong>The event is free!</strong> Please come along if you have little or no experience with distributed version control, but want to learn more. We expect you are familiar with an existing centralized revision control systems such as CVS, Subversion, or Perforce, and want to show you the new world of distributed version control.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aragost.com/2011/10/meet-us-at-goto-aarhus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gearconf 2011</title>
		<link>http://www.aragost.com/2011/06/gearconf-2011/</link>
		<comments>http://www.aragost.com/2011/06/gearconf-2011/#comments</comments>
		<pubDate>Sun, 12 Jun 2011 11:50:40 +0000</pubDate>
		<dc:creator>Martin Geisler</dc:creator>
				<category><![CDATA[Mercurial]]></category>

		<guid isPermaLink="false">http://www.aragost.com/?p=837</guid>
		<description><![CDATA[Last week I went to the Gearconf 2011 conference in Düsseldorf and I gave two talks on Mercurial: Introduction to Mercurial: this was a general talk about distributed version control in general and Mercurial in particular. Download the slides: PDF. &#8230; <a href="http://www.aragost.com/2011/06/gearconf-2011/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Last week I went to the <a href="http://gearconf.com/">Gearconf 2011</a> conference in Düsseldorf and I gave two talks on Mercurial:</p>
<ul>
<li>Introduction to Mercurial: this was a general talk about distributed version control in general and Mercurial in particular.
<p>Download the slides: <a href="https://bitbucket.org/mg/mercurial-talk/downloads/gearconf-2011-06-09.pdf">PDF</a>.</li>
<li>Query Languages in Mercurial: this was described for both revision sets and file sets. The first is a very rich SQL-like query language for specifying revisions. This is a query which will show you a combined diff of all outgoing changesets:
<pre>hg diff -r "outgoing()"</pre>
<p>The second is a similar language for specifying files in the working copy, which will let you do things like this to revert files not in the UTF-8 encoding:</p>
<pre>hg revert "set:not decodes('UTF-8')"</pre>
<p>Download the slides: <a href="https://bitbucket.org/mg/mercurial-talk/downloads/query-languages.pdf">PDF</a>.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.aragost.com/2011/06/gearconf-2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Talk: Mercurial at Wyona</title>
		<link>http://www.aragost.com/2011/03/talk-mercurial-at-wyona/</link>
		<comments>http://www.aragost.com/2011/03/talk-mercurial-at-wyona/#comments</comments>
		<pubDate>Fri, 18 Mar 2011 14:39:46 +0000</pubDate>
		<dc:creator>Martin Geisler</dc:creator>
				<category><![CDATA[Mercurial]]></category>
		<category><![CDATA[Talk]]></category>

		<guid isPermaLink="false">http://www.aragost.com/?p=763</guid>
		<description><![CDATA[Wyona began using Mercurial for the development of Yanel, an open-source CMS, some time ago, as announced on their mailinglist. Cedric Staub from Wyona and I have decided to give a joint talk about Mercurial and how they use it. &#8230; <a href="http://www.aragost.com/2011/03/talk-mercurial-at-wyona/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://wyona.com/">Wyona</a> began using Mercurial for the development of Yanel, an open-source CMS, some time ago, as <a href="http://lists.wyona.org/pipermail/yanel-development/2011-February/005495.html">announced on their mailinglist</a>. Cedric Staub from Wyona and I have decided to give a joint talk about Mercurial and how they use it. This is the abstract:</p>
<blockquote><p>Distributed version control tools like Mercurial are faster and more flexible than the traditional tools like CVS and SVN. Mercurial is used by projects ranging in size from a single developer up to very large projects such as Firefox and OpenOffice.</p>
<p>The talk will have two parts: Martin Geisler from aragost Trifork will start by giving you an introduction to Mercurial and distributed version control.</p>
<p>Afterwards, Cedric Staub from Wyona will present a case study of how switching from Subversion to Mercurial allowed for greater flexibility in their development process.</p></blockquote>
<p><strong>Date:</strong> Tuesday, April 12th at 19:30<br />
<strong>Place:</strong> Memonic, Badenerstrasse 120, 8004 Zurich</p>
<p>Please see the <a href="http://techup.ch/198/webtuesday-zurich-distributed-version-control-with-mercurial">announcement on techup.ch</a> for more details.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aragost.com/2011/03/talk-mercurial-at-wyona/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Report on Distributed Version Control</title>
		<link>http://www.aragost.com/2011/02/report-on-distributed-version-control/</link>
		<comments>http://www.aragost.com/2011/02/report-on-distributed-version-control/#comments</comments>
		<pubDate>Fri, 18 Feb 2011 11:37:36 +0000</pubDate>
		<dc:creator>Martin Geisler</dc:creator>
				<category><![CDATA[Mercurial]]></category>

		<guid isPermaLink="false">http://www.aragost.com/?p=738</guid>
		<description><![CDATA[DVCS is Essential for Distributed Teams The Burton Group (part of Gartner) published a 25 page report on February 1st that does a pretty good job at describing the strengths and weaknesses of distributed revision control. It focuses on Mercurial &#8230; <a href="http://www.aragost.com/2011/02/report-on-distributed-version-control/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h1>DVCS is Essential for Distributed Teams</h1>
<p>The <a href="http://burtongroup.com/">Burton Group</a> (part of <a href="http://gartner.com/">Gartner</a>) published a 25 page report on February 1st that does a pretty good job at describing the strengths and weaknesses of distributed revision control. It focuses on Mercurial and Git, which it calls the open source market leaders.</p>
<h2>Strengths</h2>
<p>The report says that distributed version control tools have unique features that can improve developer productivity. Some of the most important features mentioned in the report are:</p>
<ul>
<li>DVCS tools provide zero-cost, seamless branching.</li>
<li>DVCS tools merge more efficiently and automatically than traditional CVCS tools.</li>
</ul>
<p>In addition, the report stresses that tools like Mercurial and Git promote developer collaboration and communication and that both tools have large communities that provide extensive documentation and guidance.</p>
<p>I will add that the extra speed you gain by having local access to the source code history suddenly enables entirely new workflows: you can now search efficiently through the past history to find out when a bug was introduced. This is important to know so that you can provide your customers with a fixed release.</p>
<h2>Weaknesses</h2>
<p>The report also discusses some challenges in adopting a DVCS tool:</p>
<ul>
<li>The paradigm shift of DVCS tools may require process change and comes with a learning curve.</li>
<li>Administrators may need to reorganize source code into several repositories.</li>
</ul>
<p>This is true — making changes to an essential tool like a version control system will require changes in the way developers think and in how administrators work. We believe these changes are for the better, but there will be changes.</p>
<p>The report also says that no dedicated support exists for the leading DVCS tools since they are open source. While this might have been true some years ago, it is no longer the case: aragost Trifork provides a full range of support for Mercurial. We help you with the initial analysis and planning, with the actual migration, and with training of your developers. There exists similar options for Git and, as the report mentions on the very same page, there is extensive documentation and guidance available for both systems.</p>
<p>The report also claims that:</p>
<ul>
<li>Open source DVCS tools typically have lackluster GUI front ends, and some don&#8217;t port easily to Windows and OS X.</li>
</ul>
<p>This is mentioned in several places throughout the report and I believe the reason for this is that the report makes a sharp distinction between the core tool (the command line tool you get from the <a href="http://mercurial.selenic.com/">Mercurial homepage</a>) and third-party front-ends such as <a href="http://tortoisehg.org/">TortoiseHg</a>. This distinction is unnecessary: TortoiseHg is the recommended way to install Mercurial on Windows and it comes with a full-features graphical front-end for Mercurial. You can use TortoiseHg for all your Mercurial work and you wont have to use the command line tool (which is installed as well in case you sometimes prefer it).</p>
<p>For Mac OS X we have the beautiful <a href="http://jasonfharris.com/machg/">MacHg</a> front-end, which is a full, native Mac OS X program that looks and behaves like any other program you would find on your Mac.</p>
<p>Finally, the report lists the license as a potential problem for Mercurial and Git:</p>
<ul>
<li>The licensing model of open source DVCS tools may be unacceptable to some organizations.</li>
</ul>
<p>Both tools are licensed under the <a href="http://www.gnu.org/licenses/gpl-2.0.html">GNU GPL</a>, the most widely used open source license. I think listing this as a problem is a red herring: <strong>you are not restricted by the license</strong> when you install and use Mercurial. The license grants you the right to install and use Mercurial on as many machines that you like and it grants you <em>an additional right</em> when it says that you can also distribute derived versions of Mercurial under the GPL. You or your company will not be making any derived versions of Mercurial — your company will most likely have enough to do with producing and selling its own software.</p>
<h2>Download</h2>
<p>The report is unfortunately not free, but you can <a href="http://www.burtongroup.com/Research/PublicDocument.aspx?cid=2146">buy a copy online</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aragost.com/2011/02/report-on-distributed-version-control/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mercurial Sprint in Karlsruhe</title>
		<link>http://www.aragost.com/2011/02/mercurial-sprint-in-karlsruhe/</link>
		<comments>http://www.aragost.com/2011/02/mercurial-sprint-in-karlsruhe/#comments</comments>
		<pubDate>Thu, 03 Feb 2011 08:48:39 +0000</pubDate>
		<dc:creator>Martin Geisler</dc:creator>
				<category><![CDATA[Mercurial]]></category>
		<category><![CDATA[Sprint]]></category>

		<guid isPermaLink="false">http://www.aragost.com/?p=730</guid>
		<description><![CDATA[Martin Geisler from aragost Trifork will participate in the upcoming Mercurial mini-sprint in Karlsruhe next month. This will be a great opportunity for some of the Mercurial developers to get together and do some concentrated hacking. If you are in &#8230; <a href="http://www.aragost.com/2011/02/mercurial-sprint-in-karlsruhe/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Martin Geisler from aragost Trifork will participate in the upcoming <a href="http://mercurial.selenic.com/wiki/032011MiniSprintKarlsruhe">Mercurial mini-sprint in Karlsruhe</a> next month. This will be a great opportunity for some of the Mercurial developers to get together and do some concentrated hacking.</p>
<p>If you are in the area, then you should consider joining! Come <a href="http://webchat.freenode.net/?channels=mercurial">talk to us on IRC</a> and put your name on the wiki page linked above. We will sponsor beer and soda for the event, so you wont be thirsty! <img src='http://www.aragost.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.aragost.com/2011/02/mercurial-sprint-in-karlsruhe/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mercurial — Fast, scalable revision control</title>
		<link>http://www.aragost.com/2011/01/mercurial-fast-scalable-revision-control/</link>
		<comments>http://www.aragost.com/2011/01/mercurial-fast-scalable-revision-control/#comments</comments>
		<pubDate>Fri, 21 Jan 2011 15:33:20 +0000</pubDate>
		<dc:creator>Erik Zielke</dc:creator>
				<category><![CDATA[Mercurial]]></category>

		<guid isPermaLink="false">http://www.aragost.com/?p=668</guid>
		<description><![CDATA[This is an English version of an article published in the German magazine OBJEKTspektrum by SIGS-DATACOM. The authors are: Martin Geisler: A core developer of Mercurial. Lives in Zürich and work for aragost Trifork ag as a Mercurial consultant helping &#8230; <a href="http://www.aragost.com/2011/01/mercurial-fast-scalable-revision-control/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This is an English version of <a href="http://www.sigs-datacom.de/fileadmin/user_upload/zeitschriften/os/2011/01/geisler_digula_bucka_OS_01_11.pdf"> an article published in the German magazine OBJEKTspektrum by SIGS-DATACOM</a>. The authors are:</p>
<ul>
<li>Martin Geisler: A core developer of Mercurial. Lives in Zürich and work for aragost Trifork ag as a Mercurial consultant helping others with Mercurial.</li>
<li>Aaron Digulla: A Mercurial user and works as a Senior Java Developer at Avanon in Zürich.</li>
<li>Klaus Bucka-Lassen: A Mercurial user and managing director of aragost Trifork ag. He lives in Switzerland where he is mainly works as a technology consultant, project leader, architecht and software developer.</li>
</ul>
<h1>Mercurial</h1>
<h2>Fast, scalable revision control</h2>
<p>Abstract: Distributed revision control is now widely used in the industry and by many open source projects. This article takes a closer look at Mercurial, one of the fastest and most user friendly distributed revision control systems, and explains how it works and why you would want to use one.</p>
<h1>Introduction</h1>
<p>Just like Subversion solved many of the problems with CVS, distributed revision control systems like Mercurial and Git solve many of the issues with Subversion. They are faster, more flexible, much better at handling branches and merges, and encourage a better style of development.</p>
<p>The main issue with Subversion and similar centralized revision control tools is that they fail to help users when they need it most. Instead of being an ally that provides a safety net for your experiments, centralized tools discourage experiments and many developers come to see them more as a burden than a help. A new wave of distributed version control systems changes these things drastically, and this article will show you how.</p>
<p>The core feature of a distributed revision control system (DVCS) is the distribution of history &#8212; instead of having just a single repository stored on a central server, you now have many redundant repositories. In fact, each developer has his own, private repository.</p>
<p>By moving the full project history out to the developers own machine, a lot of operations suddenly become very fast. When things are fast, people tend to use them more. This means that developers will want to make more and better commits with Mercurial. When a commit takes 0.1 seconds instead of 3 seconds (or more), then you will begin making more logical commits. Small commits that each contain one coherent change are easier to review. This will be elaborated below.</p>
<p>Mercurial is an open source and cross platform system used by large organizations such as Mozilla Foundation (Firefox, Thunderbird, …) and Sun (OpenSolaris, Java, OpenOffice…) as well as many other companies and open source projects.</p>
<h1>Key Concepts</h1>
<p>There are a number of important concepts that must be understood to work efficiently with Mercurial.</p>
<h2>Working with a Single Repository</h2>
<p>The first is the notion of your<em> working copy</em>. This is where all the files in your project live and this is where you edit them. When you make a commit, the changes made in the working copy are saved as a new <em>changeset</em>. Changesets are also often called <em>revisions</em>, just like in Subversion. The changesets make up the project history and live in the <em>repository</em>, which is always stored in the <span style="font-family: courier new;">.hg/</span> directory at the root of the working copy. See Figure 1.</p>
<div id="z946"><a href="http://www.aragost.com/wp-content/uploads/2011/01/singlerepository.png"><img class="alignleft size-full wp-image-669" title="singlerepository" src="http://www.aragost.com/wp-content/uploads/2011/01/singlerepository.png" alt="" width="685" height="197" /></a><br />
<strong>Figure 1:</strong> Local and remote operations.</div>
<p>The working copy reflect a given checked out revision, the so-called working copy <em>parent revision</em>. When you ask Mercurial to show the file statuses, your files in the working copy are compared to how they looked in the parent revision. You can ask Mercurial to update the working copy to reflect another revision. When you commit, the changeset you create is always a <span style="font-family: times new roman;"><em>child revision</em> that descends from the current working copy parent revision. This parent information is stored in each changeset so that it knows where it came from</span>.</p>
<h2>Working with Several Repositories</h2>
<p>Repositories can be <em>cloned</em> and this makes a full, independent copy of all the history. This is how a developer gets access to the source code initially: he clones it from some well-known location such as a central server in a company, or a homepage for an open source project. Having made his own private clone, the developer can explore the history and make new changesets, all without talking to the server he got the clone from. When new changesets are made in the server&#8217;s repository, he will <em>pull</em> them into his own clone. The symmetric operation is <em>push</em>: he uses that to push his new changesets back to the server. The two commands simply compares the two repositories and transfers missing changesets.</p>
<p>When changesets are copied from one repository to another, the parent information stored in each changeset is critical: it is used to insert the changesets at their right position in the history. The result is a graph of changesets as shown in Figure 2.</p>
<div><a href="http://www.aragost.com/wp-content/uploads/2011/01/multiplerepos.png"><img class="alignleft size-full wp-image-670" title="multiplerepos" src="http://www.aragost.com/wp-content/uploads/2011/01/multiplerepos.png" alt="" width="608" height="152" /></a></div>
<div><strong>Figure 2:</strong> A changeset graph.</div>
<p>When changesets pulled and pushed between repositories, small branches appear in the history. They represent parallel lines of development, e.g., if Alice created a new changeset A and Bob created a new changeset B, and if both A and B descends from changeset X, then after pulling B into her clone, Alice will see two branches starting at X. The changesets A and B have no children and such changesets are called <em>heads</em>. Two heads represent divergent lines of development and should normally be merged back together. Small branches are created all the time. Compared to older tools such as Subversion, Mercurial has a much more robust merge engine that works correctly in face of renamed files and similar corner cases.</p>
<p>The command line interface for Mercurial is called <span style="font-family: courier new;">hg</span>, named after the element mercury. Just like the<span style="font-family: courier new;"> svn</span> program for Subversion, the <span style="font-family: courier new;">hg</span> program has a number of sub-commands. The most important commands are listed in Box 1. Notice how they match the commands from Subversion closely &#8212; Mercurial has been designed to make transition from Subversion as painless as possible.</p>
<div>
<div style="background-color: lightgray; padding: 5px;">Commands operating on two repositories:&nbsp;</p>
<ul>
<li><span style="font-family: courier new;">hg clone</span>: create a new repository on your local machine by copying another repository.</li>
<li><span style="font-family: courier new;">hg pull</span>: retrieve new changesets from anther repository.</li>
<li><span style="font-family: courier new;">hg push</span>: send new changesets to another repository.</li>
</ul>
<p>Commands operating on local repository only:</p>
<ul>
<li><span style="font-family: courier new;">hg status</span>: show modified/added/deleted/unknown files in the working copy.</li>
</ul>
<ul>
<li><span style="font-family: courier new;">hg diff</span>: show modifications made to files in the working copy.</li>
<li><span style="font-family: courier new;">h</span><span style="font-family: courier new;">g commit</span>: save working copy changes as a new changeset.</li>
</ul>
<ul>
<li><span style="font-family: courier new;">hg update</span>: update working copy to a given revision (often used after pull).</li>
<li><span style="font-family: courier new;">hg log</span>: show information about changesets</li>
<li><span style="font-family: courier new;">hg merge</span>: combine two lines of development.</li>
<li><span style="font-family: courier new;">hg init</span>: create a new empty repository on your local machine.</li>
</ul>
</div>
</div>
<p><strong>Box 1:</strong> The most important commands in Mercurial.</p>
<h1>Historic Background</h1>
<p>The need for keeping track of source code has existed ever since the first source code was written. There are therefore a long tradition of making revision control systems. The first generation of revision control systems worked on a single file basis only. The classic RCS program (which is simply short for „Revision Control System“) is an example of such a system and dominated the scene in the 1980s.</p>
<p>The second generation of revision control systems came with CVS, short for Concurrent Versions System. CVS and its proprietary cousins handle multiple files and support network operations. CVS enable several developers to work concurrently on the files and then merge their outstanding changes when committing them to a central server. CVS became extremely widespread in the 1990s. In 2000, Subversion (SVN) was released as a „better CVS“ and has since then replaced many CVS installations.</p>
<p>The two first generations relied on a single central server to store the history. A third generation of revision control systems is starting to remove this central server and instead offer a fully distributed workflow instead. These distributed version control systems started to appear in the beginning of this millennium, but the development really took hold in 2005 with the release of Mercurial and Git.</p>
<p>Git and Mercurial both has the same historic background. In 2005, the source code of the Linux Kernel was kept in a proprietary system called BitKeeper. The kernel developers received a free license to BitKeeper under the condition that they would not themselves work on competing products. However, this free license was revoked in the beginning of 2005, when a kernel developer made a third-party tool that would talk to the BitKeeper servers.</p>
<p>This unleashed an enormous activity in the Linux Kernel development community where a small army of very skillful programmers suddenly found themselves without a revision control system. Hackers as they were, they sat down and made their own. Linus Torvalds made a system he called Git and another kernel developer, Matt Mackall, called his system Mercurial, abbreviated „hg“ after the chemical symbol for mercury. Today, the Linux kernel is kept in Linus&#8217; system with a Mercurial mirror.</p>
<h1>The Problems with Traditional Tools</h1>
<p>Traditional version control systems such as Subversion use a client-server architectures with a central server to store the revisions of a project. This has two negative consequences:</p>
<ol>
<li>The clients must contact the server over the network for almost all operations. Subversion support diff without talking to the server, but that is it. It only supports a very limited form of diffs: you can compare a file with the working copy base revision, but not with any other revision.Contacting a server over a network connection takes much longer than accessing data on a local disk and this slows down development. The natural reaction from developers is to use the revision control tool less. Instead of making small, consistent commits they make larger commits in order to avoid talking to the server. Large commits that mix different changes are much more difficult to review and this hurts the code quality.</li>
<li>With a centralized system, every commit is published immediately for all to see. It is not uncommon for people to wait with a commit because they are afraid of breaking the build.This means that people instead sit on their uncommitted changes for days or weeks without committing. So instead of encouraging developers to track their progress step by step (including false starts), a centralized tool makes people not want to use it.Branches are supposed to help solve this problem: each developer gets his own branch where he can make all the mistakes he want without disturbing the rest of the team. However, branches are only interesting if you can merge them again!Subversion has very fragile merge support: try merging a branch with a renamed file that has also been modified on trunk. Depending on the version, Subversion will either say there is a conflict or it will silently(!) throw away the change. This bug has been there for years.The fact is that merging is a hard problem and tools like Subversion do not support it very well. The result is that people either avoid branches and sit on their code for a long time, or that they use branches but are burned when they try to merge them again.</li>
</ol>
<h2><a id="Benefits_of_Distributed_Versio" name="Benefits_of_Distributed_Versio"></a>Benefits of Distributed Version Control</h2>
<p>In Mercurial, the history is stored redundantly on several servers. Each developer has local access to the full history and this makes it very fast to work with. When switching to Mercurial, people naturally tend to make much more fine-grained commits simply because it&#8217;s easy and fast.</p>
<p>Also, when developers commit changes to their own local repositories, the repositories begin to diverge. The histories are brought back in sync with a merge &#8212; so by necessity, Mercurial has excellent support for merges. Branches are created and merged back together on a daily basis and become a natural part of the workflow.</p>
<p>Branches are an enormously useful concept and with a distributed system, developers become used to working with them. They can therefore use them efficiently on all scales: for a small bugfix or for tracking major lines of development.</p>
<h2>Better Workflows</h2>
<p>Mercurial gives a better workflow for the individual developer or within a single team. But being distributed also makes it possible to improve workflows that involve several teams. A great example of this is off-shoring. With Subversion all teams but one must suffer from extra-long network round trips since there is only one server.</p>
<p>Mercurial allows you to put a hub at each site. The developers use this to get quick, local access to each others changes. The hubs are then synchronized periodically. You simply don&#8217;t get this kind of flexibility with a centralized system.</p>
<div id="l3wj"><a href="http://www.aragost.com/wp-content/uploads/2011/01/workflows.png"><img class="size-full wp-image-671 aligncenter" title="workflows" src="http://www.aragost.com/wp-content/uploads/2011/01/workflows.png" alt="" width="602" height="380" /></a></div>
<p><strong>Figure 3:</strong> Globally distributed development with local hubs.</p>
<p>Changes flow from one repository to another and it is straight-forward to impose conditions on when a change can move to another repository. This can be used for mandatory code reviews: developers push their changes to a holding-repository where they sit until a reviewer approves or rejects them. This reviewer could be a team-leader or it could be an automated continuous integration system. When a change passes review, it is pushed further along to a central repository. The other developers will then see it and they can then integrate it into their own repository.</p>
<h1>Implementation</h1>
<p>The preceding sections looked at Mercurial from a very high-level view &#8212; this section will dive right into the nitty-gritty details of how Mercurial is implemented. Mercurial tracks three things:</p>
<ol>
<li>Changes to file content (file edits)</li>
<li>Changes to the file tree (added and removed files)</li>
<li>Information about who made the above changes</li>
</ol>
<p>The history of each file under revision control is kept in a filelog stored under <span style="font-family: courier new;">.hg/store/data/</span>. For files with a large history, there are actually two files: a <span style="font-family: courier new;">file.i</span> which holds an index and a <span style="font-family: courier new;">file.d</span> which holds the revision data itself. While this may look innocent in itself, it turns out that filenames are a somewhat messy subject.</p>
<h2>Encoding Filenames</h2>
<p>Mercurial repositories are often put on memory sticks and carried around to different computers with different operating systems. Different operating systems have different opinions on what constitutes a valid filename: Linux filesystems generally allow any byte except &#8220;<span style="font-family: courier new;">\0</span>&#8221; and &#8220;<span style="font-family: courier new;">/</span>&#8220;, Windows filesystems are more restrictive and disallows characters such as “<span style="font-family: courier new;">:</span>” and “<span style="font-family: courier new;">?</span>” but also normal looking filenames such as “<span style="font-family: courier new;">aux</span>” and “<span style="font-family: courier new;">nul</span>” (they are DOS device files and still reserved today). Mercurial needs to ensure that files stored under the <span style="font-family: courier new;">.hg</span> folder are readable on any filesystem. The filenames are therefore encoded to a safe subset of ASCII.</p>
<p>While this mapping ensures that a repository can be copied around between different machines, it does not ensure that one can always make a successful checkout. In other words, there is nothing that prevents a Linux user from adding a file called <span style="font-family: courier new;">aux</span>. The history for this file will be stored in<span style="font-family: courier new;">.hg/store/data/au~78.d</span>, which is a legal filename on a Windows filesystem. So a Windows user can pull the changeset and browse the history using TortoiseHg, say, but he cannot use <span style="font-family: courier new;">hg update</span> to checkout the file. There is an extension for Mercurial called <span style="font-family: courier new;">caseguard</span> which can be enabled to catch such problems. It was originally designed to prevent the more simple problem of a Linux user adding files that differ only in the case of the filename.</p>
<p>The file tree is tracked in a file called the manifest. The manifest looks similar to the output of <span style="font-family: courier new;">ls -R</span>except that there is a hash-value stored for each file. The manifest changes as files are added and removed from the tree, and the hash values change when the files are modified. To reconstruct the project as it stood at a certain revision, one simply has to reconstruct the right revision of the manifest and then use this to lookup the right revisions in the referenced filelogs.</p>
<p>Finally, the who-did-what part is tracked in file called the changelog. When a new commit is made, metadata such as username, date, and the commit message is recorded in the changelog file. The changelog also points to a particular revision of the manifest in order to tie the change to a particular file tree.</p>
<h2>The Revision Log</h2>
<p>The basic building block in Mercurial is the revlog, which is short for &#8220;revision log&#8221;. This is an append-only data structure that is used to implement both filelogs, the manifest and the changelog itself. A revlog stores a series of revisions and does so in a simple, yet efficient way. When a new revision is added – such as a new version of a file in case of a filelog – the delta (difference) between the last revision is computed and compressed. The compressed delta is appended to the revlog. However, simply appending deltas like this would make it increasingly expensive to reconstruct new revisions of a given file since one would have to read and process all the differences since the very first version. To prevent this, the revlog automatically stores a compressed snapshot of the file if it determines that the chain of deltas has grown too large. This ensures that the time needed to reconstruct any revision of the file does not grow when the number of revisions grow.</p>
<p>Furthermore, the revlog is append-only: when a new revision is added, the compressed delta or the compressed snapshot is simply appended to the file. The primary benefit of this is that any revision of a file can be reconstructed using a single seek to find the beginning of the delta chain (or snapshot) and a single read operation to read the needed deltas (or snapshot). By avoiding seeks, the data can be read very efficiently by a normal hard drive. A secondary benefit is that appending to files is inherently more safe than rewriting them. If the computer crashes while Mercurial is appending to one of its files, then it is easy to recover to a known good state: simply truncate each file to its original length (which was stored at the beginning of the transaction). The user can then re-do the commit or pull operation.</p>
<h2>Avoiding Locks</h2>
<p>Mercurial is a multiuser system where several users may push changesets to a central server at the same time while other users are pulling changesets. Mercurial must ensure that this is done in an orderly fashion without people stepping on each other&#8217;s toes.</p>
<p>As described above, the final file data is found by first visiting the changelog. This points to a manifest, which in turn points to the filelogs. When new changesets are added to a repository, the data is written in the opposite order: first the filelogs are extended, then the manifest is written and finally the changelog is updated. This can be done concurrently with readers since they wont notice or care about the new data until they see it referenced from the changelog. Reading can thus be done without taking any locks at all. This is rather important since read operations are by far the most common operation and also because the reader quite often cannot expect to be able to take a lock due to filesystem permissions (you should be able to clone a repository with nothing but read-access to the files in the repository). Multiple writers need to lock the repository to serialize their access to the files.</p>
<div id="bg9d"><a href="http://www.aragost.com/wp-content/uploads/2011/01/locks.png"><img class="size-full wp-image-672 aligncenter" title="locks" src="http://www.aragost.com/wp-content/uploads/2011/01/locks.png" alt="" width="703" height="425" /></a></div>
<p><strong>Figure 3:</strong> Relationships between the changelog, manifest, and file logs.</p>
<h2>Identifying Changesets</h2>
<p>Each changeset in Mercurial is given a unique identifier. With a centralized system it is easy to use sequential integers as identifiers: the clients simply ask the server for the next number in the sequence. With a distributed system where the clients must be able to work in complete isolation, something more clever is needed. First of all, it is clear that a simple integer sequence won&#8217;t be enough when identifiers must be globally unique – if Alice calls her changeset number 37, then Bob won&#8217;t know about it when he is working in a train without an Internet connection.</p>
<p>One possibility would be to assign a completely random identifier to each changeset. Given a sufficiently large space of identifiers, the risk of a collision can be made arbitrarily small. For example, one could make the risk smaller than the chance of winning the lottery – not just winning a single time, but winning again and again, every day of your life!</p>
<p>There is a better alternative, though: using a cryptographic hash function. A cryptographically secure hash function H takes an input string of arbitrary length and maps it to an output of fixed length, say, 160 bit. To be secure, a hash function must be hard to invert, that is, given a hash value <em>h</em>, it must be extremely difficult to find an <em>m</em>, such that <em>H</em>(<em>m</em>) = <em>h</em>. It should also be hard to find two different messages that hash to the same value. Hash functions play a key role in modern cryptographic systems.</p>
<p>Armed with a cryptographically secure hash function (Mercurial uses the industry standard SHA-1 function and we plan to switch to a more secure hash function when SHA-1 is broken in the future), it is now possible to construct changeset identifiers (changeset hashes) in a completely systematic way and still avoid the problem of Alice and Bob assigning the same identifier to different changesets. The key trick is to use the content of the change itself together with the changeset hashes of the parent changesets as input to the hash function.</p>
<p>Concretely, each Mercurial changeset is identified by a 40 character hexadecimal hash value – though only 12 characters is shown in the interface by default since this is normally more than enough to differentiate changesets. The hash value is computed from these components:</p>
<ul>
<li>The manifest hash</li>
<li>The username</li>
<li>The current date</li>
<li>The commit message</li>
<li>Hash value of first parent changeset</li>
<li>Hash value of second parent</li>
</ul>
<p>The manifest hash is computed in a similar fashion by giving the filelog hashes as inputs to SHA-1. The filelog hashes themselves originate from the actual file content. This design ensures that a byte in a file affects the filelog hash, which in turn affects the manifest hash, which in turn affects the changeset hash. Put differently: because it is infeasible to find collisions for the hash function, the changeset hash fixes the manifest hash. This means that if you are given the changeset hash from a trusted source, then you can download everything else from an untrusted server and afterwards verify the integrity of the data. You know that it is infeasible to find two manifest hash values that gives the same changeset hash, so when you have retrieved one manifest hash from the untrusted server, then you can be sure it&#8217;s the correct value when it gives the correct changeset hash. Similarly for the filelogs: if they hash to the correct manifest hash, then they must be correct with overwhelming probability.</p>
<p>Because the changeset hash include the hash values of the parent changesets, the entire history of the repository is included in the hash value! Given a trustworthy changeset hash, it can be verified that the parent hash values are trustworthy. The integrity of the entire history graph can be verified by walking backwards from the tip-most changeset to the root in this recursive fashion.</p>
<p>Using a cryptographic hash function to verify the history like this was pioneered by the Monotone distributed revision control system and has since then been used in both Mercurial and Git.</p>
<h1>Upcoming Features</h1>
<p>There is a growing community around Mercurial that continuously add new features and fix bugs. We will focus on two features below which will hopefully soon be included in Mercurial.</p>
<h2>Shallow Clones</h2>
<p>A Mercurial repository can grow large over time as changesets are added and as more and more files are put under version control. While the technological advances in harddisk sizes and bandwidth will be able to keep up with the expansion to some extend, it would often be nice if one could work on only a subset of the files or a subset of the history. The first feature is called “narrow clones” since they only clone a narrow subtree of the full project tree, and the second feature is called “shallow clones” since they only clone a shallow part of the full changeset graph.</p>
<p>Mercurial participates in Google&#8217;s Summer of Code program and three students will spend their summer implementing new features, see Box 2. In particular, a student will work on implementing shallow clones. Shallow clones are often requested by organizations that have converted a very old CVS repository to Mercurial – say with 10 or 20 years of history. For their day to day development, they don&#8217;t need access to the ancient versions of the code, and so a shallow clone would be a nice way to save on the bandwidth and disk space needed.</p>
<div style="background-color: lightgray; padding: 5px;">
<p>Google&#8217;s Summer of Code program was started in 2005. It is a great initiative that aims to motivating university students to join an open source project of their choice and be paid to do so. The students receive $5,000 upon succesful completion of the project. When studying Computer Science, joining an open source project is a great way to gain real world experience in software development.</p>
<p>However, there are still many students that miss out on this opportunity and the Summer of Code program aims to change this. Over 2,500 students have already successfully completed the program.</p>
</div>
<p><strong>Kasten 2:</strong> Google&#8217;s Summer of Code program.</p>
<p>The way history is stored by Mercurial lends itself well to shallow clones. The history for each file is stored sequentially in a single revlog, and by collapsing the first <em>N</em> revisions of a revlog into a single snapshot, one can effectively exclude the first <em>N</em> revisions. This snapshot will naturally have the wrong SHA-1 hash value, so Mercurial will have to be taught to ignore this for shallow clones.</p>
<p>The main difficulty in implementing shallow clones is in the handling of merges. If the changeset graph is simply cut off at a certain depth below the tip, then you may lose important information needed for correct merges. This could be information about renamed files: if <span style="font-family: courier new;">old.txt</span> is renamed to <span style="font-family: courier new;">new.txt</span> in a changeset that is not part of the shallow clone, then Mercurial will see the two files as independent. Merging will therefore give a different result in a shallow clone compared to a full clone.</p>
<p>This is of course not acceptable, so the current proposal for shallow clones requires that there must be a single root for a shallow clone. This means that if you want to make a shallow clone that involves changesets on two different branches, then you must extend the shallow clone back to the first common ancestor changeset between the two braches. This not a very limiting requirement since most projects have regular points in time where all branches are merged into a single changeset, e.g., when a release is made.</p>
<p>When a shallow clone contains a single root changeset only, then merges will be identical to merges in full clones, which is what we want for consistency and to make the mental model simple for the users. When the summer is over, then it will be known if the student succeeded with the project.</p>
<h2>Dealing with Big Files</h2>
<p>One area where distributed version control systems have a disadvantage compared with centralized systems is in handling of very large files. Large files tend to be compressed already (think of images or movies), which means that they cannot be compressed any further. To make things worse, even a small change to a binary file can lead to a very different file on disk, so the deltas between each revision will also tend to be large.</p>
<p>When the entire history is stored on each client, a big file will keep taking up space everywhere and initial clones will take longer because they need to transport more data. In a centralized system, you can simply delete a big file again if you added it by mistake and it will then only be the server that has to keep a copy of the file. After the file has been deleted, a checkout will again be fast since the clients only retrieve the last revision from the server.</p>
<p>Greg Ward, a long time Python developer, has written an extension for Mercurial called <span style="font-family: courier new;">bfiles</span>. It combines the strengths of both centralized and distributed version control by storing the big files in a central location, while letting you work with all the smaller files like normal. When you retrieve a clone of your Mercurial repository, you only retrieve the small files plus a number of “stand-in files”. These stand-in files are small files that reference the big files by the SHA-1 hash value of the big file. Using the stand-in files, Mercurial can now retrieve the needed big files. This saves you from downloading the entire history of each big file – you only get what you need. All the revisions of the big files are still stored on the server, but since storage space is cheap, it is no problem to add more disks to a central server. This design gives you the best of both worlds: you get the full history for your smaller files so that you can still search through them with <span style="font-family: courier new;">hg grep</span> and you can still compare them with <span style="font-family: courier new;">hg diff</span>, and you save disk space on the clients and bandwidth when making a clone.</p>
<p>The extension currently requires the use of a number of special commands such as <span style="font-family: courier new;">hg bfupdate</span> after a<span style="font-family: courier new;"> hg update</span> to actually update the big files. When complete, the extension will allow full integration in the normal Mercurial workflow in order to make the use as seamless as possible.</p>
<h1>Conclusion</h1>
<p>Developers are smart people &#8212; if you give them a slow or tedious tool to work with, their natural reaction is to use it as little as possible. This means making bigger commits in order to not have the tool talk too often to the server. Mercurial solves this problem in the most elementary way possible: by distributing the server to all the clients. Making a commit is now a fast operation and with the history at hand, developers can begin using the history to their benefit when tracking down bugs. Being smart people, developers will see that it now pays off to make more fine-grained commits, each with a small logical unit of work.</p>
<p>Since Mercurial is a distributed tool, it must be good at merging branches. Developers will be merging daily and they will thus also become very familiar with it. When dealing with longer lived branches for new features, it is also important to merge often. Mercurial remembers what you have already merged and you can therefore do repeated merges of the main branch into your feature branch. This is the key to making merging manageable: do it often in order to keep the merge conflicts that you must deal with small. Mercurial is not magic, but it helps you as much as possible by keeping track of things and by ensuring that the conflicts you get are genuine.</p>
<p>There is a very friendly community around Mercurial. Everybody is welcome and encouraged to join the mailinglist or to come online in the <span style="font-family: courier new;">#mercurial</span>, our IRC channel at <span style="font-family: courier new;">irc.freenode.net</span> for a direct chat with the developers and other users.</p>
<h2>Acknowledgements</h2>
<p>The author would like to thank Greg Ward and Benoit Boissinot for their helpful comments.</p>
<h1>Literatur &amp; Links</h1>
<ul>
<li><a href="http://mercurial.ch/">Mercurial Links</a></li>
<li><a href="http://hgbook.red-bean.com/">Mercurial: The Definitive Guide</a></li>
<li><a href="http://hginit.com/">Hg Init: a Mercurial tutorial</a></li>
<li><a href="http://mercurial.selenic.com/wiki/Presentations?action=AttachFile&amp;do=get&amp;target=ols-mercurial-paper.pdf">Towards a Better SCM: Revlog and Mercurial</a></li>
<li><a href="http://mercurial.selenic.com/wiki/BfilesExtension">Bfiles extension</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.aragost.com/2011/01/mercurial-fast-scalable-revision-control/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mercurial Sprint in Zurich</title>
		<link>http://www.aragost.com/2011/01/mercurial-sprint-in-zurich/</link>
		<comments>http://www.aragost.com/2011/01/mercurial-sprint-in-zurich/#comments</comments>
		<pubDate>Wed, 05 Jan 2011 15:54:35 +0000</pubDate>
		<dc:creator>Martin Geisler</dc:creator>
				<category><![CDATA[Mercurial]]></category>
		<category><![CDATA[Sprint]]></category>

		<guid isPermaLink="false">http://www.aragost.com/?p=611</guid>
		<description><![CDATA[We&#8217;re hosting a small Mercurial sprint at aragost Trifork here in Zurich! Please come join us on Saturday, January 15th at 9:00 in the aragost Trifork office at Buckhauserstrasse 40, fifth floor. I will be there from the morning, but &#8230; <a href="http://www.aragost.com/2011/01/mercurial-sprint-in-zurich/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>We&#8217;re hosting a small Mercurial sprint at aragost Trifork here in Zurich! Please come join us on</p>
<blockquote><p>Saturday, January 15th at 9:00</p></blockquote>
<p>in the aragost Trifork office at <a href="http://map.search.ch/zuerich/buckhauserstr.40">Buckhauserstrasse 40</a>, fifth floor. I will be there from the morning, but you are welcome to pop by whenever it suits you best. Please <a href="mailto:mg@aragost.com">send me a mail </a>first so that I know how many people to expect. We will probably continue until we go out for dinner in the evening.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aragost.com/2011/01/mercurial-sprint-in-zurich/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mercurial and Eclipse</title>
		<link>http://www.aragost.com/2011/01/mercurial-and-eclipse/</link>
		<comments>http://www.aragost.com/2011/01/mercurial-and-eclipse/#comments</comments>
		<pubDate>Wed, 05 Jan 2011 15:42:12 +0000</pubDate>
		<dc:creator>Erik Zielke</dc:creator>
				<category><![CDATA[Mercurial]]></category>

		<guid isPermaLink="false">http://www.aragost.com/?p=414</guid>
		<description><![CDATA[When creating and editing code, you will probably want to use an IDE. Since you then edit your code within an IDE, this will also be a natural place to integrate with source control management. Luckily most major IDEs come &#8230; <a href="http://www.aragost.com/2011/01/mercurial-and-eclipse/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>When creating and editing code, you will probably want to use an IDE. Since you then edit your code within an IDE, this will also be a natural place to integrate with source control management. Luckily most major IDEs come with Mercurial support.</p>
<p>This post will go through the very basics of using Mercurial from within Eclipse, via the MercurialEclipse plugin.</p>
<h1>Getting the Plugin</h1>
<p>The MercurialEclipse plugin can be installed either from Eclipse Marketplace, under <strong>Help → Eclipse MarketPlace&#8230;</strong> or from an Eclipe Update Site for MercurialEclipse. See more on the <a href="http://javaforge.com/project/HGE#download">MercurialEclipse homepage</a>.<a href="http://javaforge.com/project/HGE#download"></a></p>
<p>When installing from Eclipse Marketplace it is not possible to install Mercurial binaries, so there you have to install Mercurial yourself. If you choose the update site you can choose to have the Windows binaries installed with MercurialEclipse. However, this is an older version of Mercurial compared to what you would get if you installed, say, <a href="http://tortoisehg.org/">TortoiseHg</a>. What I usually do is install TortoiseHG with the bundled Mercurial, and make MercurialEclipse use that installation. Since Mercurial is very stable, it is not a problem to change to a newer version than MercurialEclipse is made to work with.</p>
<h1>Creating a Repository</h1>
<p>The recommended practice in Mercurial is one repository per project, and this is also what will be assumed in this tutorial.</p>
<p>Although Mercurial is a distributed version control system then people often use a central repository as the canonical repository, but you can of course also create your repository locally. This is done in the following way: Right click on the project you want to make into a repository → choose <strong>Team → Share Project&#8230;</strong> (Img 1)</p>
<div id="attachment_520" class="wp-caption aligncenter" style="width: 646px"><a href="http://www.aragost.com/wp-content/uploads/2011/01/shareproject.png"><img class="size-full wp-image-520" title="shareproject" src="http://www.aragost.com/wp-content/uploads/2011/01/shareproject.png" alt="" width="636" height="677" /></a><p class="wp-caption-text">Img 1</p></div>
<p>This brings up a dialog (Img 2) asking which repository plugin you want to use to share your project. Since this is about Mercurial, we will choose  Mercurial.</p>
<div id="attachment_521" class="wp-caption aligncenter" style="width: 545px"><a href="http://www.aragost.com/wp-content/uploads/2011/01/shareproject2.png"><img class="size-full wp-image-521" title="shareproject2" src="http://www.aragost.com/wp-content/uploads/2011/01/shareproject2.png" alt="" width="535" height="441" /></a><p class="wp-caption-text">Img 2</p></div>
<p>Now you have the possibility to use the current  project folder as the  root of your repository (Img 3), or you can choose  to initialize a  repository somewhere else. There will not be a  connection between the  project and the repository, if you choose the  somewhere else option. So  lets just use the project folder as our  repository.</p>
<div id="attachment_522" class="wp-caption aligncenter" style="width: 541px"><a href="http://www.aragost.com/wp-content/uploads/2011/01/shareproject3.png"><img class="size-full wp-image-522" title="shareproject3" src="http://www.aragost.com/wp-content/uploads/2011/01/shareproject3.png" alt="" width="531" height="436" /></a><p class="wp-caption-text">Img 3</p></div>
<p>Now we have initialized the root folder of our project as a repository. So now we can see the status of the  repository in the  navigator (Img 4),  and a lot of version control  commands are  available under the <strong>Team</strong> context menu, for the project and for the file. The essential ones of these will be described below.</p>
<div id="attachment_523" class="wp-caption aligncenter" style="width: 263px"><a href="http://www.aragost.com/wp-content/uploads/2011/01/shareproject4.png"><img class="size-full wp-image-523" title="shareproject4" src="http://www.aragost.com/wp-content/uploads/2011/01/shareproject4.png" alt="" width="253" height="97" /></a><p class="wp-caption-text">Img 4</p></div>
<h1>Cloning</h1>
<p>If the repository is already created, you can clone a repository by choosing<strong> File <strong>→ New </strong><strong>→ </strong></strong><strong><strong>Project&#8230;</strong></strong> and then choose the Clone Existing Mercurial Repository wizard (Img 5)</p>
<div id="attachment_513" class="wp-caption aligncenter" style="width: 542px"><a href="http://www.aragost.com/wp-content/uploads/2011/01/hgclone.jpg"><img class="size-full wp-image-513" title="hgclone" src="http://www.aragost.com/wp-content/uploads/2011/01/hgclone.jpg" alt="" width="532" height="675" /></a><p class="wp-caption-text">Img 5</p></div>
<p>The wizard then lets you then specify the url to clone from and other options, like username and password if required. (Img 6).</p>
<div id="attachment_553" class="wp-caption aligncenter" style="width: 465px"><a href="http://www.aragost.com/wp-content/uploads/2011/01/image6.png"><img class="size-full wp-image-553" title="image6" src="http://www.aragost.com/wp-content/uploads/2011/01/image6.png" alt="" width="455" height="632" /></a><p class="wp-caption-text">Img 6</p></div>
<p>When the clone has been made, a new dialog is shown (Img 7). This dialog lets you choose which revision the working copy should be updated to. You can both type a revision or select one, by browsing the tabs in Img 7.</p>
<div id="attachment_556" class="wp-caption aligncenter" style="width: 467px"><a href="http://www.aragost.com/wp-content/uploads/2011/01/image7.png"><img class="size-full wp-image-556" title="image7" src="http://www.aragost.com/wp-content/uploads/2011/01/image7.png" alt="" width="457" height="626" /></a><p class="wp-caption-text">Img 7</p></div>
<p>The final dialog lets you decide whether what now has been cloned should be imported into Eclipse workspace (Img 8).</p>
<div id="attachment_559" class="wp-caption aligncenter" style="width: 460px"><a href="http://www.aragost.com/wp-content/uploads/2011/01/image8.png"><img class="size-full wp-image-559" title="image8" src="http://www.aragost.com/wp-content/uploads/2011/01/image8.png" alt="" width="450" height="632" /></a><p class="wp-caption-text">Img 8</p></div>
<p>As we saw when creating a new repository, the working directory status is shown in the Project Explorer (Img 9).</p>
<div id="attachment_512" class="wp-caption aligncenter" style="width: 263px"><a href="http://www.aragost.com/wp-content/uploads/2011/01/clone5.png"><img class="size-full wp-image-512" title="clone5" src="http://www.aragost.com/wp-content/uploads/2011/01/clone5.png" alt="" width="253" height="111" /></a><p class="wp-caption-text">Img 9</p></div>
<h1>Committing</h1>
<p>To make a commit use <strong>Team <strong>→ </strong> Commit&#8230; </strong> for the context menu for a project or a file if you want to commit a single file. This brings up a dialog (Img 10), where you have to enter a commit message and can specify some other commit options, e.g. leaving out some files.</p>
<div id="attachment_525" class="wp-caption aligncenter" style="width: 540px"><a href="http://www.aragost.com/wp-content/uploads/2011/01/commit.png"><img class="size-full wp-image-525" title="commit" src="http://www.aragost.com/wp-content/uploads/2011/01/commit.png" alt="" width="530" height="599" /></a><p class="wp-caption-text">Img 10</p></div>
<h1>Pushing and Pulling</h1>
<p>Since Mercurial is a distributed version control system, commits are only local. To push these to another repository, e.g. the canonical one, one should use <strong>Team <strong>→ </strong>Push&#8230;</strong> under the team menu for the project context menu. This also brings up a dialog, where the push destination can be entered and other options can be set (Img 11).</p>
<div id="attachment_568" class="wp-caption aligncenter" style="width: 466px"><a href="http://www.aragost.com/wp-content/uploads/2011/01/push1.png"><img class="size-full wp-image-568" title="push1" src="http://www.aragost.com/wp-content/uploads/2011/01/push1.png" alt="" width="456" height="624" /></a><p class="wp-caption-text">Img 11</p></div>
<p>After you have set the options for pushing, then a new dialog window is shown (Img 12). Here it is possible to see all the changesets thats going to be pushed, and by clicking on a changeset, it can be seen what it consists of. So here you can check if you really want to push the changes your are about to. When you are sure, then push the changes by pressing the Finish button.</p>
<div id="attachment_569" class="wp-caption aligncenter" style="width: 466px"><a href="http://www.aragost.com/wp-content/uploads/2011/01/push2.png"><img class="size-full wp-image-569" title="push2" src="http://www.aragost.com/wp-content/uploads/2011/01/push2.png" alt="" width="456" height="624" /></a><p class="wp-caption-text">Img 12</p></div>
<p>If we want to receive changes from another repository then this is done in a similar way (Img 13 and Img 14), but of course starting with the <strong>Team <strong>→ Pull&#8230;</strong></strong> menu item instead. One thing to notice is that default behavior of pull in MercurialEclipse is to update after pull, which is different from the default behavior when pulling from the command line.</p>
<div id="attachment_572" class="wp-caption aligncenter" style="width: 470px"><a href="http://www.aragost.com/wp-content/uploads/2011/01/pull1.png"><img class="size-full wp-image-572" title="pull1" src="http://www.aragost.com/wp-content/uploads/2011/01/pull1.png" alt="" width="460" height="635" /></a><p class="wp-caption-text">Img 13</p></div>
<p>Just as you get to see the outgoing changesets when pulling, you get to see the incoming ones before pulling, so you can check whether you really want to pull in those changes.</p>
<div id="attachment_573" class="wp-caption aligncenter" style="width: 470px"><a href="http://www.aragost.com/wp-content/uploads/2011/01/pull2.png"><img class="size-full wp-image-573" title="pull2" src="http://www.aragost.com/wp-content/uploads/2011/01/pull2.png" alt="" width="460" height="635" /></a><p class="wp-caption-text">Img 14</p></div>
<h1>Update</h1>
<p>In the <strong>Team </strong>menu for the project there is an <strong>Update </strong>menu item. This will update the working directory to the tip of the current named branch.</p>
<div id="attachment_605" class="wp-caption aligncenter" style="width: 613px"><a href="http://www.aragost.com/wp-content/uploads/2011/01/switchto1.png"><img class="size-full wp-image-605 " title="switchto" src="http://www.aragost.com/wp-content/uploads/2011/01/switchto1.png" alt="" width="603" height="742" /></a><p class="wp-caption-text">Img 15</p></div>
<p style="text-align: center;">
<p>If the working directory should be updated to a different revision, then the <strong>Team  <strong> <strong>→ </strong></strong>Switch To&#8230;</strong> menu item should be chosen, which brings up a dialog to select the place in history to update the working directory to.</p>
<div id="attachment_575" class="wp-caption aligncenter" style="width: 400px"><a href="http://www.aragost.com/wp-content/uploads/2011/01/switchto.png"><img class="size-full wp-image-575" title="switchto" src="http://www.aragost.com/wp-content/uploads/2011/01/switchto.png" alt="" width="390" height="399" /></a><p class="wp-caption-text">Img 16</p></div>
<h1>Show History</h1>
<p>A reason to have a version control system is to be able to see the earlier states of the project. The <strong>Team </strong>menu includes a <strong>Show History</strong> both for the project, and for the files. Both will bring up a History view showing a revision graph, with information on the changesets, and if a changeset is selected, then more specific information on this changeset is shown (Img 17). If <strong>Show History</strong> is done on a file, only changesets in which the file was changed are shown.</p>
<p>There can also be updated to a revision from the History View, by right clicking on a changeset and select <strong>Switch Repository to Selected Changeset</strong>.</p>
<div id="attachment_578" class="wp-caption aligncenter" style="width: 610px"><a href="http://www.aragost.com/wp-content/uploads/2011/01/showhistory1.png"><img class="size-full wp-image-578" title="showhistory1" src="http://www.aragost.com/wp-content/uploads/2011/01/showhistory1.png" alt="" width="600" height="342" /></a><p class="wp-caption-text">Image 17</p></div>
<p>When a changeset is selected, files edited in that changeset is shown,  and can be opened or compared with current or previous version of that  file (Img 18).</p>
<div id="attachment_579" class="wp-caption aligncenter" style="width: 602px"><a href="http://www.aragost.com/wp-content/uploads/2011/01/showhistory21.png"><img class="size-full wp-image-579" title="showhistory2" src="http://www.aragost.com/wp-content/uploads/2011/01/showhistory21.png" alt="" width="592" height="333" /></a><p class="wp-caption-text">Image 18</p></div>
<p>If the History View shows history for a specific file, then two   revision can be compared by selecting two revisions, right clicking on   one of them and choose compare with each other (Img 19).</p>
<div id="attachment_580" class="wp-caption aligncenter" style="width: 605px"><a href="http://www.aragost.com/wp-content/uploads/2011/01/showhistory31.png"><img class="size-full wp-image-580  " title="showhistory3" src="http://www.aragost.com/wp-content/uploads/2011/01/showhistory31.png" alt="" width="595" height="422" /></a><p class="wp-caption-text">Image 19</p></div>
<h1>Merging</h1>
<p>To perform a merge choose <strong>Team <strong> <strong>→ </strong></strong>Merge&#8230;</strong> from the team menu from the project context menu. Choose the revision you want to merge with. If there is only one other head this is suggested as the revision to merge with by default (Img 20).</p>
<div id="attachment_582" class="wp-caption aligncenter" style="width: 448px"><a href="http://www.aragost.com/wp-content/uploads/2011/01/merge12.png"><img class="size-full wp-image-582" title="merge1" src="http://www.aragost.com/wp-content/uploads/2011/01/merge12.png" alt="" width="438" height="490" /></a><p class="wp-caption-text">Img 20</p></div>
<p>If the merging results in conflicts the Mercurial Merge View shows where these conflicts are (Img 21).</p>
<div id="attachment_583" class="wp-caption aligncenter" style="width: 446px"><a href="http://www.aragost.com/wp-content/uploads/2011/01/merge2.png"><img class="size-full wp-image-583" title="merge2" src="http://www.aragost.com/wp-content/uploads/2011/01/merge2.png" alt="" width="436" height="321" /></a><p class="wp-caption-text">Img 21</p></div>
<p>From this view you can bring up either the default editor for the file, or the merge editor (Img 22), which shows the difference between the two editions of the file. It is also from this view you can finish or abort a merge. A merge cannot be finished until all conflicts has been marked as resolved.</p>
<div id="attachment_584" class="wp-caption aligncenter" style="width: 394px"><a href="http://www.aragost.com/wp-content/uploads/2011/01/merge31.png"><img class="size-full wp-image-584" title="merge3" src="http://www.aragost.com/wp-content/uploads/2011/01/merge31.png" alt="" width="384" height="410" /></a><p class="wp-caption-text">Img 22</p></div>
<h1>Much More…</h1>
<p>Almost everything that can be done via the command line can also be done by MercurialEclipse, therefore a lot more things can be done from inside Eclipse, but what was described here was the very basic commands for interaction with a Mercurial repository.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aragost.com/2011/01/mercurial-and-eclipse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Technicolor Mercurial</title>
		<link>http://www.aragost.com/2010/12/technicolor-mercurial/</link>
		<comments>http://www.aragost.com/2010/12/technicolor-mercurial/#comments</comments>
		<pubDate>Mon, 13 Dec 2010 15:33:05 +0000</pubDate>
		<dc:creator>Martin Geisler</dc:creator>
				<category><![CDATA[Extension]]></category>
		<category><![CDATA[Mercurial]]></category>

		<guid isPermaLink="false">http://www.aragost.com/?p=390</guid>
		<description><![CDATA[If you use Mercurial from the command line, then should consider enabling the color extension that comes with Mercurial as a standard extension. It works on both Windows and Unix. It redefines the output routes in Mercurial to inject the &#8230; <a href="http://www.aragost.com/2010/12/technicolor-mercurial/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you use Mercurial from the command line, then should consider enabling the <a href="http://mercurial.selenic.com/wiki/ColorExtension">color extension</a> that comes with Mercurial as a standard extension. It works on both Windows and Unix. It redefines the output routes in Mercurial to inject the right escape sequences to make your terminal output beautiful color. You just have to enable it by adding two lines to your configuration file (see <strong>hg help config</strong> for help on finding the right file, which you should create if it&#8217;s not already there):</p>
<pre>[extensions]
color =
</pre>
<p>That will make Mercurial load the extension. Since it is a standard extension, you don&#8217;t have to tell Mercurial where to load it from and you can thus leave the right-hand side empty.</p>
<p>This is all the setup needed &#8212; your output will now go from</p>
<p><a href="http://www.aragost.com/wp-content/uploads/2010/12/hg-without-color.png"><img class="aligncenter size-full wp-image-394" title="Mercurial without color" src="http://www.aragost.com/wp-content/uploads/2010/12/hg-without-color.png" alt="" width="490" height="430" /></a>to</p>
<p><a href="http://www.aragost.com/wp-content/uploads/2010/12/hg-with-color.png"><img class="aligncenter size-full wp-image-395" title="Mercurial with the color extension enabled" src="http://www.aragost.com/wp-content/uploads/2010/12/hg-with-color.png" alt="" width="490" height="430" /></a>Notice how even the simple <strong>hg log</strong> command benefits from the color extension. By highlighting each changeset with a yellow line, it becomes much easier to scroll through the output with eyes.</p>
<p>The change in hg diff and hg status is even more profound. After using the color extension for a while, I am sure you will also find it almost impossible to read a diff without any highlighting.</p>
<p>It is possible to customize the colors used by the extension. If you want to have the output of <strong>hg diff</strong> look like it has been piped through <strong>colordiff</strong>, then use</p>
<pre>[color]
diff.diffline = green bold
diff.file_b = blue bold
diff.hunk = magenta bold
diff.deleted = red bold
diff.inserted = blue bold
</pre>
<p>Put those lines into your configuration file to make them take effect:</p>
<p><a href="http://www.aragost.com/wp-content/uploads/2010/12/hg-with-custom-color.png"><img class="aligncenter size-full wp-image-396" title="hg diff output with colors from colordiff" src="http://www.aragost.com/wp-content/uploads/2010/12/hg-with-custom-color.png" alt="" width="490" height="150" /></a>As you can see, there are a number of labels and each is assigned a color. The color names are: &#8220;none&#8221;, &#8220;black&#8221;, &#8220;red&#8221;, &#8220;green&#8221;, &#8220;yellow&#8221;, &#8220;blue&#8221;, &#8220;magenta&#8221;, &#8220;cyan&#8221;, &#8220;white&#8221; for foreground colors, and the same names with &#8220;_background&#8221; appended to set the background. After choosing a color, you can decide to make it more intensive by adding the keyword &#8220;bold&#8221;, you can make it underlined with the keyword &#8220;underline&#8221;, and you can ask for reverse video with &#8220;inverse&#8221;.</p>
<p>In addition to the labels I showed you above for customizing <strong>hg diff</strong>, there are other labels for <strong>hg status</strong>, <strong>hg log</strong>, etc. See <strong>hg help color</strong> for the full list.</p>
<p>If you miss color support for a particular command, then please write the <a href="mailto:mercurial@selenic.com">Mercurial mailinglist</a> and I&#8217;m sure we can help you.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aragost.com/2010/12/technicolor-mercurial/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mercurial Geek Night II</title>
		<link>http://www.aragost.com/2010/12/mercurial-geek-night-ii/</link>
		<comments>http://www.aragost.com/2010/12/mercurial-geek-night-ii/#comments</comments>
		<pubDate>Sat, 11 Dec 2010 12:07:18 +0000</pubDate>
		<dc:creator>Martin Geisler</dc:creator>
				<category><![CDATA[Geek Night]]></category>
		<category><![CDATA[Mercurial]]></category>

		<guid isPermaLink="false">http://www.aragost.com/?p=406</guid>
		<description><![CDATA[<strong>Free Geek Night on Mercurial:</strong> January 13th at 17:00 in Technopark, Zurich.

Are you curious about how you can improve your workflow with Mercurial? In this free Geek Night, <i>Martin Geisler</i> from aragost Trifork and <i>Gonzalo Casas</i> from isonet ag will introduce you to Mercurial. You will see first-hand how Mercurial is much more light-weight and flexible than legacy systems like CVS, Subversion, ClearCase, etc. <a href="http://www.aragost.com/2010/12/mercurial-geek-night-ii/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong>Update:</strong> You can now download the slides by <a href="https://bitbucket.org/mg/mercurial-talk/downloads/technopark-2011-01-13-aragost.pdf">Martin Geisler</a> and <a href="https://bitbucket.org/mg/mercurial-talk/downloads/technopark-2011-01-13-isonet.pdf">Gonzalo Casas</a> from Bitbucket.</p>
<p>Re-posted from the <a href="http://trifork.ch/2011/01/13/mercurial-geek-night-3/">Trifork blog</a>:</p>
<p><strong>Abstract:</strong></p>
<p>Are you curious about how you can improve your workflows with <a href="http://www.mercurial.ch/" target="_blank">Mercurial</a>? In this Geek Night, Martin Geisler from <a href="../" target="_blank">aragost Trifork</a> will introduce you to Mercurial, a fast distributed version control system used by large projects such as Firefox and OpenOffice. You will see first-hand how Mercurial is much more light-weight and flexible than legacy systems like CVS, Subversion, ClearCase, etc.</p>
<p>Following the introduction, Gonzalo Casas from <a href="http://www.isonet.ch/" target="_blank">isonet ag</a> will describe how and why they migrated 20 developers from Subversion to Mercurial. You will learn how the robust support for merging in Mercurial makes it feasible for them to manage long-term maintenance branches, while still being able to easily create new branches for new features.</p>
<p><strong>Speaker Bios:</strong></p>
<p>Martin Geisler holds a PhD in Computer Science from the University of Aarhus, Denmark. He has been involved in the Mercurial project for three years and is now a member of the core developer team. He relocated to Zurich in the beginning of 2010 to work full-time as a Mercurial consultant for aragost Trifork.</p>
<p>Gonzalo Casas studied Computer Science at the University Siglo 21, Córdoba, Argentina. He currently works for isonet ag as a software engineer and has been in charge of migrating from Subversion to Mercurial and maintaining the Mercurial repositories and the development process on top of it.</p>
<p><strong>Language:</strong> English<br />
<strong>Place:</strong> Technopark Zurich<br />
<strong>Date &amp; Time:</strong> 13th January 2011, 17.00<br />
<strong>Price:</strong> Free<br />
<strong>Registration:</strong> Please send name and company address to <a href="mailto:sec@trifork.com">Serife Cakmak</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aragost.com/2010/12/mercurial-geek-night-ii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

