|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>HgInit: Repository Architecture</title>
<script src="c/jquery-1.4.1.js"></script>
<script src="c/basic.js"></script>
<link href="c/styles.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-225715-20");
pageTracker._setDomainName("none");
pageTracker._setAllowLinker(true);
pageTracker._trackPageview();
} catch(err) {}</script>
<!-- Google Website Optimizer Control Script -->
<script>
function utmx_section(){}function utmx(){}
(function(){var k='2687020024',d=document,l=d.location,c=d.cookie;function f(n){
if(c){var i=c.indexOf(n+'=');if(i>-1){var j=c.indexOf(';',i);return c.substring(i+n.
length+1,j<0?c.length:j)}}}var x=f('__utmx'),xx=f('__utmxx'),h=l.hash;
d.write('<sc'+'ript src="'+
'http'+(l.protocol=='https:'?'s://ssl':'://www')+'.google-analytics.com'
+'/siteopt.js?v=1&utmxkey='+k+'&utmx='+(x?x:'')+'&utmxx='+(xx?xx:'')+'&utmxtime='
+new Date().valueOf()+(h?'&utmxhash='+escape(h.substr(1)):'')+
'" type="text/javascript" charset="utf-8"></sc'+'ript>')})();
</script><script>utmx("url",'A/B');</script>
<!-- End of Google Website Optimizer Control Script -->
</head>
<body>
<div id="kilnFlyOut">
<div class="flyouttext">
<strong>Kiln gives you:</strong><br />
• A complete version control system
based on <a href="http://mercurial.selenic.com/" target="_blank" onClick="javascript: pageTracker._trackPageview('/outbound/flyout/mercurial.selenic.com');">Mercurial</a><br />
• <a href="http://fogcreek.com/kiln/learnmore.html#hist_BranchAndMerge" target="_blank" onClick="javascript: pageTracker._trackPageview('/outbound/flyout/branchandmerge.kilnhg.com');">Branching and merging</a> that really works
</div>
<div class="flyouttext">
• <a href="http://fogcreek.com/kiln/learnmore.html#hist_Tools" target="_blank" onClick="javascript: pageTracker._trackPageview('/outbound/flyout/tools.kilnhg.com');">Straightforward setup</a> on your server, or simple secure hosting on ours<br />
• Seamlessly integrated <a href="http://fogcreek.com/kiln/learnmore.html#hist_StartReviewsEffortlessly" target="_blank" onClick="javascript: pageTracker._trackPageview('/outbound/flyout/startreviews.kilnhg.com');">code review</a>
</div>
<div class="flyouttext"> <a href="convert.html" target="_blank" onClick="javascript: pageTracker._trackPageview('/outbound/flyout/freetrial.shop.fogcreek.com');"><img src="i/getstarted.gif" width="182" height="24" border="0" /></a>
</div>
<div class="flyoutteaser"><nobr><strong>Try Kiln free!</strong> Mercurial hosting and more.</nobr></div>
</div>
<div class="toptop" align="left">
<ul>
<li align="center"><a href="http://www.joelonsoftware.com/" onClick="javascript: pageTracker._trackPageview('/outbound/toptop/joelonsoftware.com');">Joel on Software</a></li>
<li align="center"><a href="http://mercurial.selenic.com/" onClick="javascript: pageTracker._trackPageview('/outbound/toptop/mercurial.selenic.com');">Mercurial</a></li>
<li align="center"><a href="index.html">Home</a></li>
</ul>
</div>
<div id="dropshadow"></div>
<div id="topnav">
<div class="tInterior">
<a href="index.html">
<img src="i/logo.png" border="0" alt="HgInit Home" />
</a>
Mercurial gives you a great deal of flexibility in setting up repositories. Since merges work so well, you can depend on them, which means you can keep special-purpose repos around to match your development process.
</div>
</div>
<div class="main">
<h1>Repository Architecture</h1>
<div class="content">
<p>Our recipe is getting pretty good:</p>
<div class="codesnippet">
<div class="codetop"> </div>
<pre>
C:\Users\joel\recipes> <strong>hg log -l 3</strong>
changeset: 13:1b03ab783b17
tag: tip
parent: 12:f923c9049234
parent: 11:0bd396c9b89b
user: Rose Hillman <rose@example.com>
date: Thu Feb 11 23:01:55 2010 -0500
summary: merge
changeset: 12:f923c9049234
parent: 10:8646f8cd7154
user: Rose Hillman <rose@example.com>
date: Thu Feb 11 22:49:31 2010 -0500
summary: mmmmango
changeset: 11:0bd396c9b89b
user: Joel Spolsky <joel@joelonsoftware.com>
date: Thu Feb 11 22:46:47 2010 -0500
summary: bananas YUM
</pre>
<div class="codebottom"> </div>
</div>
<p>Let’s look more closely at that changeset number:</p>
<div class="codesnippet">
<div class="codetop"> </div>
<pre>
changeset: <strong>13</strong>:1b03ab783b17
</pre>
<div class="codebottom"> </div>
</div>
<p>The first part of the number, 13, is short and convenient. There’s only one problem… it’s not reliable!</p>
<p>When people on the team work separately and then merge their work, those short numbers get out of sync:</p>
<img src="i/05-repo.png" />
<p>So, for all intents and purposes, I can’t tell people “OK, let’s ship the revision based on changeset 13”, because they might have a different idea of what 13 is. That’s why there’s that crazy hexadecimal number.</p>
<div class="codesnippet">
<div class="codetop"> </div>
<pre>
changeset: 13:<strong>1b03ab783b17</strong>
</pre>
<div class="codebottom"> </div>
</div>
<p>The hexadecimal number <em>is</em> consistent across all repositories and will never change.</p>
<p>OK, so now I could tell people, “Hey, we’re shipping today! Changeset number 1b03ab783b17! Wouldn’t it be nice if I could give this changeset a <em>name</em>?</p>
<p>Well, you can. It’s called a <strong>tag</strong>.</p>
<div class="codesnippet">
<div class="codetop"> </div>
<pre>
C:\Users\joel\recipes> <strong>hg tag Version-1.0</strong>
</pre>
<div class="codebottom"> </div>
</div>
<p>Let’s look at the log now:</p>
<div class="codesnippet">
<div class="codetop"> </div>
<pre>
C:\Users\joel\recipes> <strong>hg log -l 2</strong>
changeset: 14:1adc88356f40
tag: tip
user: Joel Spolsky <joel@joelonsoftware.com>
date: Fri Feb 12 09:38:06 2010 -0500
summary: Added tag Version-1.0 for changeset 1b03ab783b17
changeset: 13:1b03ab783b17
tag: Version-1.0
parent: 12:f923c9049234
parent: 11:0bd396c9b89b
user: Rose Hillman <rose@example.com>
date: Thu Feb 11 23:01:55 2010 -0500
summary: merge
</pre>
<div class="codebottom"> </div>
</div>
<p>Notice that the the very act of adding the tag was a changeset, and it got committed automatically for me. So now, every time I want to refer to the version of the code that we shipped, I can use <strong>Version-1.0</strong> instead of <strong>1b03ab783b17</strong>.</p>
<p>The CEO came down from the 31st floor for the office ship party, with a crate of rather expensive looking sparkling wine. Stan got a little bit drunk. Well, not a little. Nobody had ever seen anything like it. He was taking off his shirt, showing off his muscles and not insignificant flab, and trying to impress some women from the marketing department. “I’m gonna do pullups from the lights,” he brags (we have these long fluorescent lights). So he jumps up, grabs the fixture, and of course, pulls down the whole thing immediately, since it was a ten pound light fixture hanging from a couple of thin pieces of piano wire, and his weight was somewhere in that hotly contested zone between 290 and 300 pounds. He pulls down the whole light and a lot of ceiling tiles, too, shattered glass and acoustic-tile-material everywhere, and lands smack on his tailbone whining about how he’s going to sue the company for making an unsafe work environment.</p>
<p>The rest of us went back to our cubes, to work on Guac 2.0.</p>
<div class="edit1">
<div class="edittopbefore">
guac </div>
<div class="editcontent">
* 2 ripe Hass avocados (not Haas)<br />
* 1/2 red onion, minced (about 1/2 cup)<br />
* 1-2 jalapeno chiles, stems and seeds removed, minced<br />
* 2 tablespoons cilantro leaves, finely chopped<br />
* 1 tablespoon of fresh lime or lemon juice<br />
* 1/2 teaspoon coarse salt<br />
* A dash of freshly grated black pepper<br />
* 1/2 ripe tomato, seeds and pulp removed, chopped<br />
* 1 ripe young Mango, in season.<br />
* 1 delicious, yellow BANANA.<br />
</div>
<img src="i/edit-bot.gif" width="387" height="76" />
</div>
<div class="edit2">
<img src="i/arrow2.gif" width="83" height="97" class="editArrow" />
<div class="edittopafter">
guac
</div>
<div class="editcontent">
<strong>GUACAMOLE 2.0 THIS IS GOING TO BE AWESOME</strong><br /><br />
* 2<strong>00</strong> ripe Hass avocados (not Haas)<br />
* 1/2 red onion, minced (about 1/2 cup)<br />
* 1-2 jalapeno chiles, stems and seeds removed, minced<br />
* 2 tablespoons cilantro leaves, finely chopped<br />
* 1 tablespoon of fresh lime or lemon juice<br />
* 1/2 teaspoon coarse salt<br />
* A dash of freshly grated black pepper<br />
* 1/2 ripe tomato, seeds and pulp removed, chopped<br />
* 1 ripe young Mango, in season.<br />
* 1 delicious, yellow BANANA.<br />
</div>
<img src="i/edit-bot.gif" width="387" height="76" />
</div>
<div style="clear: both;"> </div>
<p>Commit:</p>
<div class="codesnippet">
<div class="codetop"> </div>
<pre>
C:\Users\joel\recipes> <strong>hg com -m "more avocado flavor"</strong>
</pre>
<div class="codebottom"> </div>
</div>
<p>Needless to say, the recipe here is in a very unsettled state. It hasn’t been tested or anything. And then, the (one) customer calls up.</p>
<p>“It’s too salty!” he whimpers. And no, he doesn’t want to wait for version 2.0 for a fix.</p>
<p>Luckily, we’ve got that tag. I can use <strong>hg up</strong> to go to any version in the repository.</p>
<div class="codesnippet">
<div class="codetop"> </div>
<pre>
C:\Users\joel\recipes> <strong>hg up -r Version-1.0</strong>
1 files updated, 0 files merged, 1 files removed, 0 files unresolved
C:\Users\joel\recipes> <strong>type guac</strong>
* 2 ripe Hass avocados (not Haas)
* 1/2 red onion, minced (about 1/2 cup)
* 1-2 jalapeno chiles, stems and seeds removed, minced
...
</pre>
<div class="codebottom"> </div>
</div>
<p>And now I can fix his stupid salt problem:</p>
<div class="edit1">
<div class="edittopbefore">
guac </div>
<div class="editcontent">
* 2 ripe Hass avocados (not Haas)<br />
* 1/2 red onion, minced (about 1/2 cup)<br />
* 1-2 jalapeno chiles, stems and seeds removed, minced<br />
* 2 tablespoons cilantro leaves, finely chopped<br />
* 1 tablespoon of fresh lime or lemon juice<br />
* 1/2 teaspoon coarse salt<br />
* A dash of freshly grated black pepper<br />
* 1/2 ripe tomato, seeds and pulp removed, chopped<br />
* 1 ripe young Mango, in season.<br />
* 1 delicious, yellow BANANA.<br />
</div>
<img src="i/edit-bot.gif" width="387" height="76" />
</div>
<div class="edit2">
<img src="i/arrow2.gif" width="83" height="97" class="editArrow" />
<div class="edittopafter">
guac
</div>
<div class="editcontent">
* 2 ripe Hass avocados (not Haas)<br />
* 1/2 red onion, minced (about 1/2 cup)<br />
* 1-2 jalapeno chiles, stems and seeds removed, minced<br />
* 2 tablespoons cilantro leaves, finely chopped<br />
* 1 tablespoon of fresh lime or lemon juice<br />
* <strong>1 grain table </strong>salt<strong>, split in half</strong><br />
* A dash of freshly grated black pepper<br />
* 1/2 ripe tomato, seeds and pulp removed, chopped<br />
* 1 ripe young Mango, in season.<br />
* 1 delicious, yellow BANANA.<br />
</div>
<img src="i/edit-bot.gif" width="387" height="76" />
</div>
<div style="clear: both;"> </div>
<p>And:</p>
<div class="codesnippet">
<div class="codetop"> </div>
<pre>
C:\Users\joel\recipes> <strong>hg diff</strong>
diff -r 1b03ab783b17 guac
--- a/guac Thu Feb 11 23:01:55 2010 -0500
+++ b/guac Fri Feb 12 10:44:19 2010 -0500
@@ -3,7 +3,7 @@
* 1-2 jalapeno chiles, stems and seeds removed, minced
* 2 tablespoons cilantro leaves, finely chopped
* 1 tablespoon of fresh lime or lemon juice
-* 1/2 teaspoon coarse salt
+* 1 grain table salt, split in half
* A dash of freshly grated black pepper
* 1/2 ripe tomato, seeds and pulp removed, chopped
* 1 ripe young Mango, in season.
C:\Users\joel\recipes> <strong>hg com -m "less salt"</strong>
created new head
</pre>
<div class="codebottom"> </div>
</div>
<p>Mercurial reminds me that I’ve created a new head. There are two heads now, the 2.0 head I was working on a second ago, and the 1.1 head I just committed.</p>
<img src="i/05-repo-2.png" />
<p>Now I can ship this to my customer, tag it as 1.1, and go back to work on version 2.0.</p>
<div class="codesnippet">
<div class="codetop"> </div>
<pre>
C:\Users\joel\recipes> <strong>hg tag -r . Version-1.1</strong>
C:\Users\joel\recipes> <strong>hg log -l 3</strong>
changeset: 17:f4220e321145
tag: tip
user: Joel Spolsky <joel@joelonsoftware.com>
date: Fri Feb 12 11:17:02 2010 -0500
summary: Added tag Version-1.1 for changeset 60ddc0122eb4
changeset: 16:60ddc0122eb4
tag: Version-1.1
parent: 13:1b03ab783b17
user: Joel Spolsky <joel@joelonsoftware.com>
date: Fri Feb 12 10:44:32 2010 -0500
summary: less salt
changeset: 15:90c349eca2e8
user: Joel Spolsky <joel@joelonsoftware.com>
date: Fri Feb 12 10:31:24 2010 -0500
summary: more avocado flavor
C:\Users\joel\recipes> <strong>hg up -r 15</strong>
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
C:\Users\joel\recipes> <strong>type guac</strong>
GUACAMOLE 2.0 THIS IS GOING TO BE AWESOME
* 200 ripe Hass avocados (not Haas)
* 1/2 red onion, minced (about 1/2 cup)
* 1-2 jalapeno chiles, stems and seeds removed, minced
* 2 tablespoons cilantro leaves, finely chopped
* 1 tablespoon of fresh lime or lemon juice
* 1/2 teaspoon coarse salt
* A dash of freshly grated black pepper
* 1/2 ripe tomato, seeds and pulp removed, chopped
* 1 ripe young Mango, in season.
* 1 delicious, yellow BANANA.
...
</pre>
<div class="codebottom"> </div>
</div>
<p>Only one problem… the salt fix is not here. How do I solve that?</p>
<div class="codesnippet">
<div class="codetop"> </div>
<pre>
C:\Users\joel\recipes> <strong>hg merge</strong>
merging .hgtags
</pre>
<div class="codebottom"> </div>
</div>
<img src="i/05-kdiff3.png" />
<p>Uh oh. I have to merge the tags. This is an annoying bug in Mercurial. The problem is that tags in Mercurial are just a file, named .hgtags, which is also under version control, so occasionally, you have to manually merge different versions of the .hgtags file. Whenever that happens, what you have to do is easy… always keep BOTH versions of every line in the file.</p>
<div class="codesnippet">
<div class="codetop"> </div>
<pre>
merging guac
0 files updated, 2 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
C:\Users\joel\recipes> <strong>hg diff guac</strong>
diff -r 90c349eca2e8 guac
--- a/guac Fri Feb 12 10:31:24 2010 -0500
+++ b/guac Fri Feb 12 11:32:43 2010 -0500
@@ -5,7 +5,7 @@
* 1-2 jalapeno chiles, stems and seeds removed, minced
* 2 tablespoons cilantro leaves, finely chopped
* 1 tablespoon of fresh lime or lemon juice
-* 1/2 teaspoon coarse salt
+* 1 grain table salt, split in half
* A dash of freshly grated black pepper
* 1/2 ripe tomato, seeds and pulp removed, chopped
* 1 ripe young Mango, in season.
C:\Users\joel\recipes> <strong>hg com -m "bringing in salt fix from 1.1"</strong>
</pre>
<div class="codebottom"> </div>
</div>
<p>This simple method of going back to old, tagged versions is fine for when you just want to make one little unexpected fix to shipping code. But the truth is, in most software projects, this kind of stuff happens all the time, and Mercurial has a more robust way to deal with it.</p>
<p>So I’m just going to undo all that post-1.0 work, and get the repository back to the way it was when I had just shipped 1.0, and then I can show you the fancy robust way to fix existing customers’ bugs while working on a future version at the same time.</p>
<div class="codesnippet">
<div class="codetop"> </div>
<pre>
C:\Users\joel\recipes> <strong>cd ..</strong>
C:\Users\joel> <strong>hg clone -r 14 recipes recipes-stable</strong>
requesting all changes
adding changesets
adding manifests
adding file changes
added 15 changesets with 15 changes to 2 files
updating to branch default
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
C:\Users\joel> <strong>cd recipes-stable</strong>
C:\Users\joel\recipes-stable> <strong>hg log -l 3</strong>
changeset: 14:1adc88356f40
tag: tip
user: Joel Spolsky <joel@joelonsoftware.com>
date: Fri Feb 12 09:38:06 2010 -0500
summary: Added tag Version-1.0 for changeset 1b03ab783b17
changeset: 13:1b03ab783b17
tag: Version-1.0
parent: 12:f923c9049234
parent: 11:0bd396c9b89b
user: Rose Hillman <rose@example.com>
date: Thu Feb 11 23:01:55 2010 -0500
summary: merge
changeset: 12:f923c9049234
parent: 10:8646f8cd7154
user: Rose Hillman <rose@example.com>
date: Thu Feb 11 22:49:31 2010 -0500
summary: mmmmango
</pre>
<div class="codebottom"> </div>
</div>
<p>The idea is that instead of doing everything in one repository, we’re going to make two repositories, one called <strong>stable</strong> and the other called <strong>dev</strong>.</p>
<p>The <strong>stable</strong> repository holds the last major version of the code that we shipped to customers. Whenever you need to make an urgent bug fix, you do it in <strong>stable</strong>. In this example it’s going to be all the patches to 1.0.</p>
<p>The <strong>dev</strong> repository is where the next major train of development is happening, leading up to 2.0.</p>
<p>As soon as 1.0 ships, I’m going to clone <strong>stable</strong> to <strong>dev</strong>:</p>
<div class="codesnippet">
<div class="codetop"> </div>
<pre>
C:\Users\joel\recipes-stable> <strong>cd ..</strong>
C:\Users\joel> <strong>hg clone recipes-stable recipes-dev</strong>
updating to branch default
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
</pre>
<div class="codebottom"> </div>
</div>
<p>Now I have two identical repositories:</p>
<img src="i/05-repo-3.png" />
<p>Since the history of both of these repositories is the same up to changeset 14, Mercurial will actually use a file system trick called hard links to avoid making two copies on disk. That makes the <strong>hg clone</strong> operation fast and cheap, so you shouldn’t hesitate to make lots and lots and lots of clones.</p>
<p>Now we start working on that guac in the <strong>dev</strong> repository:</p>
<div class="codesnippet">
<div class="codetop"> </div>
<pre>
C:\Users\joel> <strong>cd recipes-dev</strong>
C:\Users\joel\recipes-dev> <strong>edit guac</strong>
C:\Users\joel\recipes-dev> <strong>hg diff</strong>
diff -r 1adc88356f40 guac
--- a/guac Fri Feb 12 09:38:06 2010 -0500
+++ b/guac Fri Feb 12 15:15:01 2010 -0500
@@ -1,4 +1,6 @@
-* 2 ripe Hass avocados (not Haas)
+GUACAMOLE 2.0 THIS IS GOING TO BE AWESOME
+
+* 200 ripe Hass avocados (not Haas)
* 1/2 red onion, minced (about 1/2 cup)
* 1-2 jalapeno chiles, stems and seeds removed, minced
* 2 tablespoons cilantro leaves, finely chopped
C:\Users\joel\recipes-dev> <strong>hg commit -m "more avocado flavor"</strong>
</pre>
<div class="codebottom"> </div>
</div>
<p>And fix the salt problem in the stable repository:</p>
<div class="codesnippet">
<div class="codetop"> </div>
<pre>
C:\Users\joel\recipes-dev> <strong>cd ..\recipes-stable</strong>
C:\Users\joel\recipes-stable> <strong>edit guac</strong>
C:\Users\joel\recipes-stable> <strong>hg diff</strong>
diff -r 1adc88356f40 guac
--- a/guac Fri Feb 12 09:38:06 2010 -0500
+++ b/guac Fri Feb 12 15:18:31 2010 -0500
@@ -3,7 +3,7 @@
* 1-2 jalapeno chiles, stems and seeds removed, minced
* 2 tablespoons cilantro leaves, finely chopped
* 1 tablespoon of fresh lime or lemon juice
-* 1/2 teaspoon coarse salt
+* 1 grain table salt, split in half
* A dash of freshly grated black pepper
* 1/2 ripe tomato, seeds and pulp removed, chopped
* 1 ripe young Mango, in season.
C:\Users\joel\recipes-stable> <strong>hg com -m "less salt"</strong>
</pre>
<div class="codebottom"> </div>
</div>
<p>I’ll tag that and ship it as 1.1:</p>
<div class="codesnippet">
<div class="codetop"> </div>
<pre>
C:\Users\joel\recipes-stable> <strong>hg tag Version-1.1</strong>
</pre>
<div class="codebottom"> </div>
</div>
<p>And now, every once in a while, we pull in the fixes from stable to dev:</p>
<div class="codesnippet">
<div class="codetop"> </div>
<pre>
C:\Users\joel\recipes-stable> <strong>cd ..\recipes-dev</strong>
C:\Users\joel\recipes-dev> <strong>hg in</strong>
comparing with c:\Users\joel\recipes-stable
searching for changes
changeset: 15:e05c954f961f
tag: Version-1.1
user: Joel Spolsky <joel@joelonsoftware.com>
date: Fri Feb 12 15:28:27 2010 -0500
summary: less salt
changeset: 16:f0e8768829ed
tag: tip
user: Joel Spolsky <joel@joelonsoftware.com>
date: Fri Feb 12 15:28:40 2010 -0500
summary: Added tag Version-1.1 for changeset e05c954f961f
C:\Users\joel\recipes-dev> <strong>hg pull</strong>
pulling from c:\Users\joel\recipes-stable
searching for changes
adding changesets
adding manifests
adding file changes
added 2 changesets with 2 changes to 2 files (+1 heads)
(run 'hg heads' to see heads, 'hg merge' to merge)
C:\Users\joel\recipes-dev> <strong>hg merge</strong>
merging guac
0 files updated, 1 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
C:\Users\joel\recipes-dev> <strong>hg com -m "merge"</strong>
C:\Users\joel\recipes-dev> <strong>type guac</strong>
GUACAMOLE 2.0 THIS IS GOING TO BE AWESOME
* 200 ripe Hass avocados (not Haas)
* 1/2 red onion, minced (about 1/2 cup)
* 1-2 jalapeno chiles, stems and seeds removed, minced
* 2 tablespoons cilantro leaves, finely chopped
* 1 tablespoon of fresh lime or lemon juice
* 1 grain table salt, split in half
* A dash of freshly grated black pepper
* 1/2 ripe tomato, seeds and pulp removed, chopped
* 1 ripe young Mango, in season.
* 1 delicious, yellow BANANA.
Smoosh all ingredients together.
Serve with tortilla chips.
</pre>
<div class="codebottom"> </div>
</div>
<p>Here’s what we’ve been doing:</p>
<img src="i/05-repo-4.png" />
<p>And, if you can understand <em>that</em> crazy graph, you’re well on your way to understanding Mercurial. The gist of it is that eventually the stable repository only has the bug fixes, while the dev repository has new code and bug fixes merged in.</p>
<p>There are other ways you can use multiple repositories.</p>
<ul>
<li>You can set up a team repository where a few people work on a feature together. When they are finished and the feature works well, you push the changes from the team repository to the main development repository, and then everyone else sees it.</li>
<li>You can set up a QA repository for the testers. Instead of pushing into the main repository, you push into the QA repository where your code is tested. Once the testers approve it, you push from the QA repository into the main development repository. That way the main repository always contains tested code.</li>
<li>Since each developer has their own repository, you can pull an experimental changeset from your friend to test it, without inflicting that change on the rest of the team.</li>
</ul>
<p>In large, complicated organizations, you can combine these techniques, setting up a bunch of repositories that pull from each other. As each feature goes through testing and integration, it gets pulled up higher and higher in the tree until eventually the new code is in the main shipping repository where customers can get it:</p>
<img src="i/05-complex.png" />
<h2>Test yourself</h2>
<p>Here are the things you should know how to do after reading this tutorial:</p>
<ol>
<li>Tag old versions and go back to them</li>
<li>Organize your team with “stable” and “dev” repositories</li>
</li>
</ol>
<p>Well, somehow we’ve reached the end of this tutorial. I haven’t even come <em>close</em> to covering everything in Mercurial, but there are plenty of resources to go more in depth.
There’s <a href="http://hgbook.red-bean.com/">a book</a> that covers everything in utter and complete detail. And if you have any questions, I’d like to invite you to the <a href="http://kiln.stackexchange.com/">Kiln Knowledge Exchange</a> (it’s like <a href="http://stackoverflow.com/">StackOverflow</a>, but just for Kiln, and Mercurial questions are more than welcome there.)
</p>
<div class="footer">
<div class="footernav" id="home" align="center"><a href="index.html"><span class="angleQuote">«</span> Home</a></div>
<div class="footernav" id="comingup" style=" text-align: left; margin-left: 35px;">To learn more, <a href="http://hgbook.red-bean.com/">read the book</a> or
hang out at the <a href="http://kiln.stackexchange.com/">Kiln Knowledge Exchange</a>.</div>
</div>
<div class="pagebottom">
<div class="bottomimg">
<a href="http://www.kilnhg.com" target="_blank" id="logoLink" title="KilnHg.com" onClick="javascript: pageTracker._trackPageview('/outbound/bottom/klinhg.com');"> </a>
<div class="bottomtext">This tutorial was brought to you by the fine folks at Fog Creek Software, makers of Kiln, a version control system powered by Mercurial</div>
<div class="bottomtext"><strong>Kiln gives you:</strong><br />
• A complete version control system based on <a href="http://mercurial.selenic.com/" target="_blank" onClick="javascript: pageTracker._trackPageview('/outbound/bottom/mercurial.selenic.com');">Mercurial</a><br />
• <a href="http://fogcreek.com/kiln/learnmore.html#hist_BranchAndMerge" target="_blank" onClick="javascript: pageTracker._trackPageview('/outbound/bottom/branchandmerge.kilnhg.com');">Branching and merging</a> that really works<br />
• <a href="http://fogcreek.com/kiln/learnmore.html#hist_Tools" target="_blank" onClick="javascript: pageTracker._trackPageview('/outbound/bottom/tools.kilnhg.com');">Straightforward setup</a> on your server, or simple secure hosting on ours<br />
• Seamlessly integrated <a href="http://fogcreek.com/kiln/learnmore.html#hist_StartReviewsEffortlessly" target="_blank" onClick="javascript: pageTracker._trackPageview('/outbound/bottom/startreviews.kilnhg.com');">code review</a><br />
</div>
<div class="bottomtext getStarted">
<a href="convert.html" target="_blank" onClick="javascript: pageTracker._trackPageview('/outbound/bottom/freetrial.shop.fogcreek.com');"><img src="i/getstarted.gif" width="182" height="24" border="0" /></a>
</div>
</div>
<div class="about">
<p>
<strong>Any questions?</strong>
</p>
<p>
If you have any questions about the material in this tutorial,
no matter how newbie, ask them at <a href="http://kiln.stackexchange.com/" onClick="javascript: pageTracker._trackPageview('/outbound/bottom/kiln.stackexchange.com');">the
Kiln Knowledge Exchange.</a>
</p>
<p>
<strong>About the author.</strong>
</p>
<p>
Joel Spolsky is the founder of <a href="http://fogcreek.com" onClick="javascript: pageTracker._trackPageview('/outbound/bottom/fogcreek.com');">Fog Creek Software</a>, a New York company that proves that you can treat programmers well and still be profitable. Programmers get private offices, free lunch, and work 40 hours a week. Customers only pay for software if they’re delighted. Fog Creek makes <a href="http://www.fogbugz.com" onClick="javascript: pageTracker._trackPageview('/outbound/bottom/fogbugz.com');">FogBugz</a>, <a href="http://www.kilnhg.com/" onClick="javascript: pageTracker._trackPageview('/outbound/bottom/text.kilnhg.com');">Kiln</a>, and <a href="https://www.copilot.com/" onClick="javascript: pageTracker._trackPageview('/outbound/bottom/copilot.com');">Fog Creek Copilot</a>. Joel's blog <a href="http://www.joelonsoftware.com/" onClick="javascript: pageTracker._trackPageview('/outbound/bottom/joelonsoftware.com');">Joel on Software</a> is read by programmers everywhere.
</p>
</div>
<!-- close bottom div -->
</div>
<!-- close "content" column -->
</div>
<!-- close "main" div -->
</div>
<!-- bottom grey bar -->
<div class="botbot" align="left">
</div>
<!-- Google Website Optimizer Tracking Script -->
<script type="text/javascript">
if(typeof(_gat)!='object')document.write('<sc'+'ript src="http'+
(document.location.protocol=='https:'?'s://ssl':'://www')+
'.google-analytics.com/ga.js"></sc'+'ript>')</script>
<script type="text/javascript">
try {
var gwoTracker=_gat._getTracker("UA-225715-15");
gwoTracker._trackPageview("/2687020024/test");
}catch(err){}</script>
<!-- End of Google Website Optimizer Tracking Script -->
</body>
</html>
|
Loading...