Kiln » HgInit » HgInit
Clone URL:  
03.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
<!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: Fixing Goofs</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> </head> <body> <div id="kilnFlyOut"> <div class="flyoutscreenshot"> <img class="screenshot" src="i/dag.png" /> </div> <div class="flyouttext"> <strong>Kiln gives you:</strong> <ul> <li class="first"><a class="selected thumbnail" data-src="i/dag.png" href="convert.html">Mercurial-based<br/>version control</a></li> <li><a class="thumbnail" data-src="i/setup.png" href="convert.html">Straightforward<br/>setup</a></li> <li class="last"><a class="thumbnail" data-src="i/review.png" href="convert.html">Seamless<br/>code review</a></li> </ul> <a class="convert" href="convert.html" target="_blank" onClick="javascript: pageTracker._trackPageview('/outbound/flyout/freetrial.shop.fogcreek.com');"><img src="i/getstarted.gif" width="114" height="24" border="0" /></a> </div> <div class="flyoutteaser"><nobr><strong>Try Kiln free!</strong> Easy 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> One of the biggest benefits of Mercurial is that you can use private clones to try experiments and develop new features&#8230; if they don&#8217;t work out, you can reverse them in a second. </div> </div> <div class="main"> <h1>Fixing Goofs</h1> <div class="content"> <p>Mercurial lets you experiment freely. Imagine that during the course of normal editing, you get into trouble with your editor and do something catastrophic:</p> <div class="edit1"> <div class="edittopbefore"> guac </div> <div class="editcontent"> * 2 ripe avocados<br> * 1/2 red onion, minced (about 1/2 cup)<br> * 1-2 habanero 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><br> Smoosh all ingredients together.<br> Serve with potato chips.<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 iperay avocadosway<br> * 1/2 edray onionway, incedmay (aboutway 1/2 upcay)<br> * 1-2 abanerohay ileschay, emsstay andway eedssay <br> emovedray, incedmay<br> * 2 ablespoonstay ilantrocay eaveslay, inelyfay oppedchay<br> * 1 ablespoontay ofway eshfray imelay orway emonlay <br> uicejay * 1/2 easpoontay oarsecay altsay<br> * Away ashday ofway eshlyfray atedgray ackblay epperpay<br> * 1/2 iperay omatotay, eedssay andway ulppay emovedray, <br> oppedchay<br><br> Ooshsmay allway ingredientsway ogethertay.<br> Ervesay ithway otatopay ipschay.<br> </div> <img src="i/edit-bot.gif" width="387" height="76" /> </div> <div style="clear: both;">&nbsp;</div> <p>Gotta love emacs. Anyway, all is not lost. The most common way to recover from these things is just to <strong>hg revert</strong> them:</p> <div class="cheatcontent" style="margin-top:-65px"> <div class="cheattop"> <div class="command">hg revert</div> </div> <p class="cheattext">revert changed files back to committed version </p> <img src="i/cheatbot.png" width="241" height="41" /> </div> <div class="codesnippet"> <div class="codetop"> </div> <pre> C:\Users\joel\recipes&gt; <strong>hg revert guac</strong> </pre> <div class="codebottom"> </div> </div> <p>That&#8217;ll put the files back exactly the way they were at the time of the last commit. Mercurial doesn&#8217;t like to delete anything, so instead of zapping the Pig Latin recipe, it renamed it:</p> <div class="codesnippet"> <div class="codetop"> </div> <pre> C:\Users\joel\recipes&gt; <strong>dir</strong> Volume in drive C has no label. Volume Serial Number is 84BD-9C2C Directory of C:\Users\joel\recipes 02/11/2010 11:16 AM &lt;DIR&gt; . 02/11/2010 11:16 AM &lt;DIR&gt; .. 02/11/2010 11:16 AM &lt;DIR&gt; .hg 02/11/2010 11:16 AM 393 guac 02/11/2010 11:15 AM 510 guac.orig 2 File(s) 903 bytes 3 Dir(s) 40,958,005,248 bytes free C:\Users\joel\recipes&gt; <strong>del guac</strong> C:\Users\joel\recipes&gt; <strong>rename guac.orig guac</strong> </pre> <div class="codebottom"> </div> </div> <p>What if you had gone one step too far and actually committed?</p> <div class="codesnippet"> <div class="codetop"> </div> <pre> C:\Users\joel\recipes&gt; <strong>hg com -m "Pig Latin ftw"</strong> C:\Users\joel\recipes&gt; <strong>hg log -l 3</strong> changeset: 5:c7af1973de6d tag: tip user: Joel Spolsky &lt;joel@joelonsoftware.com&gt; date: Thu Feb 11 11:32:27 2010 -0500 summary: Pig Latin ftw changeset: 4:0849ca96c304 parent: 2:4ecdb2401ab4 parent: 3:689026657682 user: Joel Spolsky &lt;joel@joelonsoftware.com&gt; date: Mon Feb 08 16:07:23 2010 -0500 summary: merge changeset: 3:689026657682 parent: 1:a52881ed530d user: Rose Hillman &lt;rose@example.com&gt; date: Mon Feb 08 15:29:09 2010 -0500 summary: spicier kind of chile </pre> <div class="codebottom"> </div> </div> <div class="cheatcontent" style="margin-top:0px"> <div class="cheattop"> <div class="command">hg rollback</div> </div> <p class="cheattext">undoes one commit, as long as you haven&#8217;t pushed it to anyone else. </p> <img src="i/cheatbot.png" width="241" height="41" /> </div> <p>There&#8217;s a command called <strong>hg rollback</strong> which will save your skin, but only if you haven&#8217;t pushed this change to anyone else. It only undoes <em>one</em> commit.</p> <div class="codesnippet"> <div class="codetop"> </div> <pre> C:\Users\joel\recipes&gt; <strong>hg rollback</strong> rolling back last transaction C:\Users\joel\recipes&gt; <strong>hg log -l 3</strong> changeset: 4:0849ca96c304 tag: tip parent: 2:4ecdb2401ab4 parent: 3:689026657682 user: Joel Spolsky &lt;joel@joelonsoftware.com&gt; date: Mon Feb 08 16:07:23 2010 -0500 summary: merge changeset: 3:689026657682 parent: 1:a52881ed530d user: Rose Hillman &lt;rose@example.com&gt; date: Mon Feb 08 15:29:09 2010 -0500 summary: spicier kind of chile changeset: 2:4ecdb2401ab4 user: Joel Spolsky &lt;joel@joelonsoftware.com&gt; date: Mon Feb 08 15:32:01 2010 -0500 summary: potato chips. No one can eat just one. C:\Users\joel\recipes&gt; <strong>hg stat</strong> M guac C:\Users\joel\recipes&gt; <strong>hg revert guac</strong> </pre> <div class="codebottom"> </div> </div> <p>Imagine you want to do a major experiment on the side. Your boss hired a new designer, Jim, and lately the specs you&#8217;ve been getting from him are just absurd. There&#8217;s fluorescent green text, nothing lines up (for &#8220;artistic&#8221; reasons), and the usability is awful. You want to come in one weekend and redo the whole thing, but you&#8217;re afraid to commit it because you&#8217;re not really 100% sure that your ideas are better than this nutty graphic designer. Jim is basically smoking a joint from the moment he wakes up until he goes to bed. You don&#8217;t want to hold that against him, and everybody else thinks that it&#8217;s nobody&#8217;s business as long as his designs are good, but really, there&#8217;s a limit. Right? And his designs aren&#8217;t good. Plus he&#8217;s kind of offensive.</p> <p>With Mercurial, you can just make an experimental clone of the entire repository:</p> <div class="codesnippet"> <div class="codetop"> </div> <pre> C:\Users\joel\recipes&gt; <strong>cd ..</strong> C:\Users\joel&gt; <strong>hg clone recipes recipes-experiment</strong> updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved </pre> <div class="codebottom"> </div> </div> <p>This isn&#8217;t as inefficient as it seems. Because both <strong>recipes</strong> and <strong>recipes-experiment</strong> share all their history (so far), Mercurial will use a file system trick called &#8220;hard links&#8221; so that the copy can be created very quickly, without taking up a lot of extra space on disk.</p> <p>Now we can make a bunch of changes in the experimental branch:</p> <div class="codesnippet"> <div class="codetop"> </div> <pre> C:\Users\joel&gt; <strong>cd recipes-experiment</strong> </pre> <div class="codebottom"> </div> </div> <p>Here&#8217;s my grand guacamole experiment:</p> <!-- edit text file module --> <div class="edit1"> <div class="edittopbefore"> guac </div> <div class="editcontent"> &#8230;<br><br> Smoosh all ingredients together.<br> Serve with potato chips.<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"> &#8230;<br><br> Smoosh all ingredients together.<br> Serve with potato chips.<br><br> <strong>This recipe is really good served with QUESO.<br><br> QUESO is Spanish for "cheese," but in Texas, it's just Kraft Slices melted in the microwave with some salsa from a jar. MMM!</strong><br> </span> </div> <img src="i/edit-bot.gif" width="387" height="76" /> </div> <div style="clear: both;">&nbsp;</div> <p>Here in the experimental repository, we can commit freely.</p> <div class="codesnippet"> <div class="codetop"> </div> <pre> C:\Users\joel\recipes-experiment&gt; <strong>hg com -m "Queso = Cheese!"</strong> </pre> <div class="codebottom"> </div> </div> <p>You can make changes and work freely, committing whenever you want. That gives you all the power of source control even for your crazy experiment, without infecting anyone else.</p> <p>If you decide that the experiment was misguided, you can just delete the whole experimental directory. Problem solved. It&#8217;s gone.</p> <p>But if it worked, all you have to do is push your new changes:</p> <div class="codesnippet"> <div class="codetop"> </div> <pre> C:\Users\joel\recipes-experiment&gt; <strong>hg push</strong> pushing to c:\Users\joel\recipes searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files </pre> <div class="codebottom"> </div> </div> <p>Where did they go?</p> <div class="cheatcontent" style="margin-top:0px"> <div class="cheattop"> <div class="command">hg paths</div> </div> <p class="cheattext">shows a list of known remote repositories </p> <img src="i/cheatbot.png" width="241" height="41" /> </div> <div class="codesnippet"> <div class="codetop"> </div> <pre> C:\Users\joel\recipes-experiment&gt; <strong>hg paths</strong> default = c:\Users\joel\recipes </pre> <div class="codebottom"> </div> </div> <p>The &#8220;default&#8221; entry there shows you the path to the repository that <strong>hg push</strong> will push changes to, if you don&#8217;t specify any other repository. Normally, that&#8217;s the repository that you cloned off of. In this case, it&#8217;s a local directory, but you could also have a URL there.</p> <div class="codesnippet"> <div class="codetop"> </div> <pre> C:\Users\joel\recipes-experiment&gt; <strong>cd ..\recipes</strong> </pre> <div class="codebottom"> </div> </div> <p>Don&#8217;t forget, just because the change has been pushed into this <em>repository</em>&#8230;</p> <div class="codesnippet"> <div class="codetop"> </div> <pre> C:\Users\joel\recipes&gt; <strong>hg log -l 3</strong> changeset: 5:9545248f3fc9 tag: tip user: Joel Spolsky &lt;joel@joelonsoftware.com&gt; date: Thu Feb 11 12:59:11 2010 -0500 summary: Queso = Cheese! changeset: 4:0849ca96c304 parent: 2:4ecdb2401ab4 parent: 3:689026657682 user: Joel Spolsky &lt;joel@joelonsoftware.com&gt; date: Mon Feb 08 16:07:23 2010 -0500 summary: merge changeset: 3:689026657682 parent: 1:a52881ed530d user: Rose Hillman &lt;rose@example.com&gt; date: Mon Feb 08 15:29:09 2010 -0500 summary: spicier kind of chile </pre> <div class="codebottom"> </div> </div> <p>&#8230; doesn&#8217;t mean we&#8217;re working off that version yet.</p> <div class="codesnippet"> <div class="codetop"> </div> <pre> C:\Users\joel\recipes&gt; <strong>type guac</strong> * 2 ripe avocados * 1/2 red onion, minced (about 1/2 cup) * 1-2 habanero 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 Smoosh all ingredients together. Serve with potato chips. C:\Users\joel\recipes&gt; <strong>hg parent</strong> changeset: 4:0849ca96c304 parent: 2:4ecdb2401ab4 parent: 3:689026657682 user: Joel Spolsky &lt;joel@joelonsoftware.com&gt; date: Mon Feb 08 16:07:23 2010 -0500 summary: merge </pre> <div class="codebottom"> </div> </div> <div class="cheatcontent" style="margin-top:0px"> <div class="cheattop"> <div class="command">hg parent</div> </div> <p class="cheattext">shows which changeset(s) you&#8217;re working off of </p> <img src="i/cheatbot.png" width="241" height="41" /> </div> <p>See? That &#8220;Queso&#8221; stuff is in changeset 5. But my main repository was working off of changeset 4, and just because someone pushed new changes into the <em>repository</em>, doesn&#8217;t mean they&#8217;ve showed up in my working directory yet, so I&#8217;m still working off of changeset 4.</p> <img src="i/03-repo.png" /> <p>If I want to see what&#8217;s in changeset 5, I have to use the <strong>hg update</strong> command:</p> <div class="codesnippet"> <div class="codetop"> </div> <pre> C:\Users\joel\recipes&gt; <strong>hg up</strong> 1 files updated, 0 files merged, 0 files removed, 0 files unresolved C:\Users\joel\recipes&gt; <strong>hg parent</strong> changeset: 5:9545248f3fc9 tag: tip user: Joel Spolsky &lt;joel@joelonsoftware.com&gt; date: Thu Feb 11 12:59:11 2010 -0500 summary: Queso = Cheese! C:\Users\joel\recipes&gt; <strong>type guac</strong> * 2 ripe avocados * 1/2 red onion, minced (about 1/2 cup) * 1-2 habanero 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 Smoosh all ingredients together. Serve with potato chips. This recipe is really good served with QUESO. QUESO is Spanish for &quot;cheese,&quot; but in Texas, it's just Kraft Slices melted in the microwave with some salsa from a jar. MMM! </pre> <div class="codebottom"> </div> </div> <p>See what happened here? The changes came in, but they were on top of the version I was working on. <strong>push</strong> and <strong>pull</strong> just send changes from one repo to another&#8212;they don&#8217;t affect the files I&#8217;m working on at the moment.</p> <p>Right now here&#8217;s the state of repositories:</p> <img src="i/03-repo-2.png" /> <p>Mercurial is flexible about moving changes around from repository to repository. You can push straight from the experimental repository into the central repository:</p> <div class="codesnippet"> <div class="codetop"> </div> <pre> C:\Users\joel\recipes&gt; <strong>cd ..\recipes-experiment</strong> C:\Users\joel\recipes-experiment&gt; <strong>hg outgoing http://joel.example.com:8000/</strong> comparing with http://joel.example.com:8000/ searching for changes changeset: 5:9545248f3fc9 tag: tip user: Joel Spolsky &lt;joel@joelonsoftware.com&gt; date: Thu Feb 11 12:59:11 2010 -0500 summary: Queso = Cheese! C:\Users\joel\recipes-experiment&gt; <strong>hg push http://joel.example.com:8000/</strong> pushing to http://joel.example.com:8000/ searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files </pre> <div class="codebottom"> </div> </div> <p>That pushed change 5 from the experimental repo directly into the central repository. Now, if I go back to my repository, there&#8217;s nothing left to push!</p> <div class="codesnippet"> <div class="codetop"> </div> <pre> C:\Users\joel\recipes-experiment&gt; <strong>cd ..\recipes</strong> C:\Users\joel\recipes&gt; <strong>hg out</strong> comparing with http://joel.example.com:8000/ searching for changes no changes found </pre> <div class="codebottom"> </div> </div> <p>That&#8217;s because Mercurial knows that the central repo already got this particular changeset from somewhere else. That&#8217;s really useful, because otherwise it would try to apply it again, and it would be massively confused.</p> <p>After they made a job offer to designer Jim, he said he would start work right away, but then he didn&#8217;t show up for two months. People had mostly forgotten about him and about the job offer, and when he showed up at the office for the first time to start work, looking rather sunburned, to be honest, nobody quite knew who he was or what was going on. It was pretty funny. He is kind of a generic looking guy. Eventually they figured it out, but since he was new, nobody had the guts to ask him what the hell had happened. Just like they never ask him about the bruises and scratches on his face. Whatever. We hate that guy.</p> <p>Sometimes it may happen that you discover that, months earlier, you made a mistake.</p> <div class="codesnippet"> <div class="codetop"> </div> <pre> C:\Users\joel\recipes&gt; <strong>hg diff -r 1:2 guac</strong> diff -r a52881ed530d -r 4ecdb2401ab4 guac --- a/guac Mon Feb 08 14:51:18 2010 -0500 +++ b/guac Mon Feb 08 15:32:01 2010 -0500 @@ -8,4 +8,4 @@ * 1/2 ripe tomato, seeds and pulp removed, chopped Smoosh all ingredients together. -Serve with tortilla chips. +Serve with potato chips. </pre> <div class="codebottom"> </div> </div> <p>Potato chips? WTF?!</p> <p>Mercurial can backout an old changeset from the past for you. It looks at the changeset, figures out the <em>opposite</em>, and does that to your current working directory. Let&#8217;s try backing out that old revision 2.</p> <div class="codesnippet"> <div class="codetop"> </div> <pre> C:\Users\joel\recipes&gt; <strong>hg backout -r 2 --merge</strong> reverting guac created new head changeset 6:d828920f7f85 backs out changeset 2:4ecdb2401ab4 merging with changeset 6:d828920f7f85 merging guac 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) </pre> <div class="codebottom"> </div> </div> <p>Holy crap, what just happened?</p> <div class="codesnippet"> <div class="codetop"> </div> <pre> C:\Users\joel\recipes&gt; <strong>hg diff</strong> diff -r 9545248f3fc9 guac --- a/guac Thu Feb 11 12:59:11 2010 -0500 +++ b/guac Thu Feb 11 14:19:34 2010 -0500 @@ -8,7 +8,7 @@ * 1/2 ripe tomato, seeds and pulp removed, chopped Smoosh all ingredients together. -Serve with potato chips. +Serve with tortilla chips. This recipe is really good served with QUESO. C:\Users\joel\recipes&gt; <strong>hg com -m &quot;undo thing from the past&quot;</strong> C:\Users\joel\recipes&gt; <strong>hg push</strong> pushing to http://joel.example.com:8000/ searching for changes adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 1 files </pre> <div class="codebottom"> </div> </div> <p>Now, a lot of time may have passed. The chips might already be gone from the recipe. All kinds of spooky stuff might have happened that makes it impossible to merge in this change. In that case, you&#8217;re going to get merge conflicts, which you&#8217;re going to have to resolve somehow. We&#8217;ll talk about that in the next tutorial.</p> <h2>Test yourself</h2> <p>Here are the things you should know how to do after reading this tutorial:</p> <ol> <li>Revert accidental changes, before and after checking in</li> <li>Clone a repository locally for experiments</li> <li>Push between repositories</li> <li>Revert an old mistake that&#8217;s been in the repository for ages</li> </li> </ol> <div class="footer"> <div class="footernav" id="home" align="center"><a href="index.html"><span class="angleQuote">&#171;</span> Home</a></div> <div class="footernav" id="comingup">Next, we talk about how to<br /> merge in Mercurial</div> <div class="footernav" id="next" align="center"><a href="04.html">Next <span class="angleQuote">&#187;</span></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');">&nbsp;</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 /> &#8226; 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 /> &#8226; <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 /> &#8226; <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 /> &#8226; 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="114" 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&#8217;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>