hgbook
diff en/ch09-undo.xml @ 634:d1a6ed326f87
Add package and upload script
author | Dongsheng Song <dongsheng.song@gmail.com> |
---|---|
date | Fri Mar 13 16:01:21 2009 +0800 (2009-03-13) |
parents | 13513d2a128d |
children | a13813534ccd |
line diff
1.1 --- a/en/ch09-undo.xml Mon Mar 09 23:37:29 2009 -0700 1.2 +++ b/en/ch09-undo.xml Fri Mar 13 16:01:21 2009 +0800 1.3 @@ -1,6 +1,6 @@ 1.4 <!-- vim: set filetype=docbkxml shiftwidth=2 autoindent expandtab tw=77 : --> 1.5 1.6 -<chapter id="chap:undo"> 1.7 +<chapter id="chap.undo"> 1.8 <?dbhtml filename="finding-and-fixing-mistakes.html"?> 1.9 <title>Finding and fixing mistakes</title> 1.10 1.11 @@ -27,17 +27,17 @@ 1.12 less annoying.</para> 1.13 1.14 </sect2> 1.15 - <sect2 id="sec:undo:rollback"> 1.16 + <sect2 id="sec.undo.rollback"> 1.17 <title>Rolling back a transaction</title> 1.18 1.19 - <para>In section <xref linkend="sec:concepts:txn"/>, I mentioned 1.20 + <para>In section <xref linkend="sec.concepts.txn"/>, I mentioned 1.21 that Mercurial treats each modification of a repository as a 1.22 <emphasis>transaction</emphasis>. Every time you commit a 1.23 changeset or pull changes from another repository, Mercurial 1.24 remembers what you did. You can undo, or <emphasis>roll 1.25 back</emphasis>, exactly one of these actions using the 1.26 <command role="hg-cmd">hg rollback</command> command. (See 1.27 - section <xref linkend="sec:undo:rollback-after-push"/> for an 1.28 + section <xref linkend="sec.undo.rollback-after-push"/> for an 1.29 important caveat about the use of this command.)</para> 1.30 1.31 <para>Here's a mistake that I often find myself making: 1.32 @@ -111,7 +111,7 @@ 1.33 need to undo this mistake.</para> 1.34 1.35 </sect2> 1.36 - <sect2 id="sec:undo:rollback-after-push"> 1.37 + <sect2 id="sec.undo.rollback-after-push"> 1.38 <title>Rolling back is useless once you've pushed</title> 1.39 1.40 <para>The value of the <command role="hg-cmd">hg 1.41 @@ -214,7 +214,7 @@ 1.42 the file to its unmodified contents.</para> 1.43 </listitem></itemizedlist> 1.44 1.45 - <sect2 id="sec:undo:mgmt"> 1.46 + <sect2 id="sec.undo.mgmt"> 1.47 <title>File management errors</title> 1.48 1.49 <para>The <command role="hg-cmd">hg revert</command> command is 1.50 @@ -306,7 +306,7 @@ 1.51 modifying or erasing it. It's the right tool to use if you're 1.52 fixing bugs, but not if you're trying to undo some change that 1.53 has catastrophic consequences. To deal with those, see section 1.54 - <xref linkend="sec:undo:aaaiiieee"/>.</para> 1.55 + <xref linkend="sec.undo.aaaiiieee"/>.</para> 1.56 1.57 <sect2> 1.58 <title>Backing out a changeset</title> 1.59 @@ -354,13 +354,13 @@ 1.60 that <command role="hg-cmd">hg backout</command> has created 1.61 is a child of the changeset we backed out. It's easier to see 1.62 this in figure <xref 1.63 - linkend="fig:undo:backout"/>, which presents a graphical 1.64 + linkend="fig.undo.backout"/>, which presents a graphical 1.65 view of the change history. As you can see, the history is 1.66 nice and linear.</para> 1.67 1.68 - <informalfigure id="fig:undo:backout"> 1.69 + <informalfigure id="fig.undo.backout"> 1.70 <mediaobject><imageobject><imagedata 1.71 - fileref="undo-simple"/></imageobject><textobject><phrase>XXX 1.72 + fileref="images/undo-simple.png"/></imageobject><textobject><phrase>XXX 1.73 add text</phrase></textobject><caption><para>Backing out 1.74 a change using the <command role="hg-cmd">hg 1.75 backout</command> 1.76 @@ -393,7 +393,7 @@ 1.77 &interaction.backout.non-tip.cat; 1.78 1.79 <para>As the graphical history in figure <xref 1.80 - linkend="fig:undo:backout-non-tip"/> illustrates, Mercurial 1.81 + linkend="fig.undo.backout-non-tip"/> illustrates, Mercurial 1.82 actually commits <emphasis>two</emphasis> changes in this kind 1.83 of situation (the box-shaped nodes are the ones that Mercurial 1.84 commits automatically). Before Mercurial begins the backout 1.85 @@ -406,9 +406,9 @@ 1.86 <para>% TODO: to me it looks like mercurial doesn't commit the 1.87 second merge automatically!</para> 1.88 1.89 - <informalfigure id="fig:undo:backout-non-tip"> 1.90 + <informalfigure id="fig.undo.backout-non-tip"> 1.91 <mediaobject><imageobject><imagedata 1.92 - fileref="undo-non-tip"/></imageobject><textobject><phrase>XXX 1.93 + fileref="images/undo-non-tip.png"/></imageobject><textobject><phrase>XXX 1.94 add text</phrase></textobject><caption><para>Automated 1.95 backout of a non-tip change using the <command 1.96 role="hg-cmd">hg backout</command> 1.97 @@ -465,15 +465,15 @@ 1.98 1.99 <para>Again, it's easier to see what has happened by looking at 1.100 a graph of the revision history, in figure <xref 1.101 - linkend="fig:undo:backout-manual"/>. This makes it clear 1.102 + linkend="fig.undo.backout-manual"/>. This makes it clear 1.103 that when we use <command role="hg-cmd">hg backout</command> 1.104 to back out a change other than the tip, Mercurial adds a new 1.105 head to the repository (the change it committed is 1.106 box-shaped).</para> 1.107 1.108 - <informalfigure id="fig:undo:backout-manual"> 1.109 + <informalfigure id="fig.undo.backout-manual"> 1.110 <mediaobject><imageobject><imagedata 1.111 - fileref="undo-manual"/></imageobject><textobject><phrase>XXX 1.112 + fileref="images/undo-manual.png"/></imageobject><textobject><phrase>XXX 1.113 add text</phrase></textobject><caption><para>Backing out 1.114 a change using the <command role="hg-cmd">hg 1.115 backout</command> 1.116 @@ -509,11 +509,11 @@ 1.117 1.118 <para>Afterwards, the graphical history of our repository looks 1.119 like figure 1.120 - <xref linkend="fig:undo:backout-manual-merge"/>.</para> 1.121 - 1.122 - <informalfigure id="fig:undo:backout-manual-merge"> 1.123 + <xref linkend="fig.undo.backout-manual-merge"/>.</para> 1.124 + 1.125 + <informalfigure id="fig.undo.backout-manual-merge"> 1.126 <mediaobject><imageobject><imagedata 1.127 - fileref="undo-manual-merge"/></imageobject><textobject><phrase>XXX 1.128 + fileref="images/undo-manual-merge.png"/></imageobject><textobject><phrase>XXX 1.129 add text</phrase></textobject><caption><para>Manually 1.130 merging a backout change</para></caption></mediaobject> 1.131 1.132 @@ -584,7 +584,7 @@ 1.133 are likely to have <quote>broken the context</quote> that 1.134 <command>patch</command> uses to determine whether it can 1.135 apply a patch (if this sounds like gibberish, see <xref 1.136 - linkend="sec:mq:patch"/> for a 1.137 + linkend="sec.mq.patch"/> for a 1.138 discussion of the <command>patch</command> command). Also, 1.139 Mercurial's merge machinery will handle files and directories 1.140 being renamed, permission changes, and modifications to binary 1.141 @@ -593,7 +593,7 @@ 1.142 1.143 </sect2> 1.144 </sect1> 1.145 - <sect1 id="sec:undo:aaaiiieee"> 1.146 + <sect1 id="sec.undo.aaaiiieee"> 1.147 <title>Changes that should never have been</title> 1.148 1.149 <para>Most of the time, the <command role="hg-cmd">hg 1.150 @@ -623,7 +623,7 @@ 1.151 been pushed or pulled into another repository. That's when you 1.152 can safely use the <command role="hg-cmd">hg rollback</command> 1.153 command, as I detailed in section <xref 1.154 - linkend="sec:undo:rollback"/>.</para> 1.155 + linkend="sec.undo.rollback"/>.</para> 1.156 1.157 <para>After you've pushed a bad change to another repository, you 1.158 <emphasis>could</emphasis> still use <command role="hg-cmd">hg 1.159 @@ -664,7 +664,7 @@ 1.160 central repository.</para> 1.161 1.162 <para>By configuring some hooks on that repository to validate 1.163 - incoming changesets (see chapter <xref linkend="chap:hook"/>), 1.164 + incoming changesets (see chapter <xref linkend="chap.hook"/>), 1.165 you can 1.166 automatically prevent some kinds of bad changeset from being 1.167 pushed to the central repository at all. With such a 1.168 @@ -679,7 +679,7 @@ 1.169 1.170 </sect2> 1.171 </sect1> 1.172 - <sect1 id="sec:undo:bisect"> 1.173 + <sect1 id="sec.undo.bisect"> 1.174 <title>Finding the source of a bug</title> 1.175 1.176 <para>While it's all very well to be able to back out a changeset