Commits

Bryan O'Sullivan committed 06383f9

More graphics.

Comments (0)

Files changed (5)

 
 image-sources := \
 	mq-stack.svg \
-	tour-history.svg
+	tour-history.svg \
+	tour-merge-sep-repos.svg \
+	tour-merge-pull.svg
 
 example-sources := \
 	daily.files \

en/tour-basic.tex

 The default output printed by \hgcmd{log} is purely a summary; it is
 missing a lot of detail.
 
-Figure~\ref{fig:tour:history} provides a graphical representation of
+Figure~\ref{fig:tour-basic:history} provides a graphical representation of
 the history of the \dirname{hello} repository, to make it a little
 easier to see which direction history is ``flowing'' in.  We'll be
 returning to this figure several times in this chapter and the chapter
   \centering
   \grafix{tour-history}
   \caption{Graphical history of the \dirname{hello} repository}
-  \label{fig:tour:history}
+  \label{fig:tour-basic:history}
 \end{figure}
 
 \subsection{Changesets, revisions, and talking to other 
   people}
 
 As English is a notoriously sloppy language, and computer science has
-a history of terminological confusion, revision control has a variety
-of terms that have the same meaning.  If you are talking about
-Mercurial history with other people, you will find that the word
-``changeset'' is often compressed to ``change'' or (when written)
-``cset'', and sometimes a changeset is referred to as a ``revision''
-or a ``rev''.
+a hallowed history of terminological confusion (why use one term when
+four will do?), revision control has a variety of words and phrases
+that mean the same thing.  If you are talking about Mercurial history
+with other people, you will find that the word ``changeset'' is often
+compressed to ``change'' or (when written) ``cset'', and sometimes a
+changeset is referred to as a ``revision'' or a ``rev''.
 
 While it doesn't matter what \emph{word} you use to refer to the
 concept of ``a~changeset'', the \emph{identifier} that you use to
Added
New image
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://web.resource.org/cc/"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="744.09448819"
+   height="1052.3622047"
+   id="svg2"
+   sodipodi:version="0.32"
+   inkscape:version="0.44.1"
+   sodipodi:docname="tour-merge-pull.svg"
+   sodipodi:docbase="/home/bos/hg/hgbook/en">
+  <defs
+     id="defs4">
+    <marker
+       inkscape:stockid="Arrow1Mstart"
+       orient="auto"
+       refY="0.0"
+       refX="0.0"
+       id="Arrow1Mstart"
+       style="overflow:visible">
+      <path
+         id="path2973"
+         d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none"
+         transform="scale(0.4) translate(10,0)" />
+    </marker>
+    <marker
+       inkscape:stockid="Arrow1Mend"
+       orient="auto"
+       refY="0.0"
+       refX="0.0"
+       id="Arrow1Mend"
+       style="overflow:visible;">
+      <path
+         id="path3066"
+         d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none;"
+         transform="scale(0.4) rotate(180) translate(10,0)" />
+    </marker>
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     gridtolerance="10000"
+     guidetolerance="10"
+     objecttolerance="10"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="1.4"
+     inkscape:cx="233.63208"
+     inkscape:cy="832.54381"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     inkscape:window-width="906"
+     inkscape:window-height="620"
+     inkscape:window-x="237"
+     inkscape:window-y="103" />
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1">
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:black;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Courier"
+       x="173.57143"
+       y="443.79074"
+       id="text2832"><tspan
+         sodipodi:role="line"
+         id="tspan2834"
+         x="173.57143"
+         y="443.79074" /></text>
+    <rect
+       style="fill:#a5c3c8;fill-opacity:1;stroke:#6396a0;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="rect1878"
+       width="94.285713"
+       height="20.714285"
+       x="138"
+       y="479.50504" />
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:black;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Courier"
+       x="162.09892"
+       y="493.12619"
+       id="text1872"><tspan
+         sodipodi:role="line"
+         id="tspan1874"
+         x="162.09892"
+         y="493.12619"
+         style="font-family:Courier"><tspan
+   style="font-weight:bold"
+   id="tspan1876">0</tspan>: 0a04</tspan></text>
+    <rect
+       style="fill:#a5c3c8;fill-opacity:1;stroke:#6396a0;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="rect2800"
+       width="94.285713"
+       height="20.714285"
+       x="138"
+       y="432.63004" />
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:black;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Courier"
+       x="162.09892"
+       y="446.25119"
+       id="text2794"><tspan
+         sodipodi:role="line"
+         id="tspan2796"
+         x="162.09892"
+         y="446.25119"
+         style="font-family:Courier"><tspan
+   id="tspan2868"
+   style="font-weight:bold">1</tspan>: 82e5</tspan></text>
+    <rect
+       style="fill:#a5c3c8;fill-opacity:1;stroke:#6396a0;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="rect2810"
+       width="94.285713"
+       height="20.714285"
+       x="138"
+       y="385.75504" />
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:black;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Courier"
+       x="162.09892"
+       y="399.37619"
+       id="text2804"><tspan
+         sodipodi:role="line"
+         id="tspan2806"
+         x="162.09892"
+         y="399.37619"
+         style="font-family:Courier"><tspan
+   style="font-weight:bold"
+   id="tspan2866">2</tspan>: 057d</tspan></text>
+    <rect
+       style="fill:#a5c3c8;fill-opacity:1;stroke:#6396a0;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="rect2820"
+       width="94.285713"
+       height="20.714285"
+       x="138"
+       y="338.88007" />
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:black;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Courier"
+       x="162.09892"
+       y="352.50122"
+       id="text2814"><tspan
+         sodipodi:role="line"
+         id="tspan2816"
+         x="162.09892"
+         y="352.50122"
+         style="font-family:Courier"><tspan
+   style="font-weight:bold"
+   id="tspan2864">3</tspan>: ff5d</tspan></text>
+    <rect
+       style="fill:#a5c3c8;fill-opacity:1;stroke:#6396a0;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="rect2830"
+       width="94.285713"
+       height="20.714285"
+       x="138"
+       y="292.00504" />
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:black;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Courier"
+       x="162.09892"
+       y="305.62619"
+       id="text2824"><tspan
+         sodipodi:role="line"
+         id="tspan2826"
+         x="162.09892"
+         y="305.62619"
+         style="font-family:Courier"><tspan
+   style="font-weight:bold"
+   id="tspan2862">4</tspan>: b57f</tspan></text>
+    <path
+       style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#Arrow1Mend);stroke-opacity:1"
+       d="M 185.14286,478.50504 L 185.14286,454.34432"
+       id="path2894"
+       inkscape:connector-type="polyline" />
+    <path
+       style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#Arrow1Mend);stroke-opacity:1"
+       d="M 185.14286,431.63004 L 185.14286,407.46932"
+       id="path2896"
+       inkscape:connector-type="polyline" />
+    <path
+       style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#Arrow1Mend);stroke-opacity:1"
+       d="M 185.14286,384.75504 L 185.14286,360.59435"
+       id="path2898"
+       inkscape:connector-type="polyline" />
+    <path
+       style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#Arrow1Mend);stroke-opacity:1"
+       d="M 185.14286,337.88007 L 185.14286,313.71932"
+       id="path2900"
+       inkscape:connector-type="polyline" />
+    <rect
+       style="fill:#a5c3c8;fill-opacity:1;stroke:#6396a0;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="rect2863"
+       width="94.285713"
+       height="20.714285"
+       x="91.428574"
+       y="244.71933" />
+    <text
+       xml:space="preserve"
+       style="font-size:12.00001812px;font-style:normal;font-weight:normal;fill:black;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Courier"
+       x="116.09886"
+       y="258.80865"
+       id="text1965"
+       transform="scale(1.000002,0.999998)"><tspan
+         sodipodi:role="line"
+         id="tspan1967"
+         x="116.09886"
+         y="258.80865"
+         style="font-family:Courier"><tspan
+   style="font-weight:bold"
+   id="tspan1973">5</tspan>: ae13</tspan></text>
+    <path
+       style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1.00000143px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#Arrow1Mend);stroke-opacity:1;display:inline"
+       d="M 173.95727,291.00504 L 149.75702,266.43361"
+       id="path1971"
+       inkscape:connector-type="polyline"
+       inkscape:connection-end="#rect2863"
+       inkscape:connection-start="#rect2830" />
+    <rect
+       style="fill:#78a5ad;fill-opacity:1;stroke:#507b84;stroke-width:2.00000286;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="rect2911"
+       width="94.285995"
+       height="20.714283"
+       x="186.71414"
+       y="198.6479" />
+    <text
+       xml:space="preserve"
+       style="font-size:12.00001812px;font-style:normal;font-weight:normal;fill:black;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Courier"
+       x="210.81311"
+       y="212.26949"
+       id="text2913"
+       transform="scale(1.000002,0.999998)"><tspan
+         sodipodi:role="line"
+         id="tspan2915"
+         x="210.81311"
+         y="212.26949"
+         style="font-family:Courier"><tspan
+   id="tspan1966"
+   style="font-weight:bold">6</tspan>: d2b5</tspan></text>
+    <path
+       style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1.00000143px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#Arrow1Mend);stroke-opacity:1;display:inline"
+       d="M 191.06908,291.00504 L 227.93092,220.36218"
+       id="path2919"
+       inkscape:connector-type="polyline"
+       inkscape:connection-start="#rect2830" />
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:black;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Times New Roman"
+       x="295.28571"
+       y="211.80988"
+       id="text2871"><tspan
+         sodipodi:role="line"
+         id="tspan2873"
+         x="295.28571"
+         y="211.80988">tip (and head)</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:black;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Times New Roman"
+       x="76"
+       y="259.16046"
+       id="text2875"><tspan
+         sodipodi:role="line"
+         id="tspan2877"
+         x="76"
+         y="259.16046"
+         style="text-align:end;text-anchor:end">head</tspan></text>
+  </g>
+</svg>

en/tour-merge-sep-repos.svg

Old
Old image
New
New image
    id="svg2"
    sodipodi:version="0.32"
    inkscape:version="0.44.1"
-   sodipodi:docname="tour-merge-repos.svg">
+   sodipodi:docname="tour-merge-sep-repos.svg">
   <defs
      id="defs4">
     <marker
      inkscape:pageshadow="2"
      inkscape:zoom="1.4"
      inkscape:cx="307.20351"
-     inkscape:cy="747.80768"
+     inkscape:cy="716.87911"
      inkscape:document-units="px"
      inkscape:current-layer="layer1"
      inkscape:window-width="906"
          y="267.12723"
          style="text-align:center;text-anchor:middle"
          id="tspan3132">differ</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:black;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Times New Roman"
+       x="262.15436"
+       y="398.37112"
+       id="text2929"><tspan
+         sodipodi:role="line"
+         x="262.15436"
+         y="398.37112"
+         id="tspan3013"
+         style="text-align:start;text-anchor:start">common history</tspan></text>
     <g
-       id="g3122"
+       id="g3107"
        transform="translate(0,0.855744)">
-      <text
-         id="text2929"
-         y="397.51538"
-         x="262.15436"
-         style="font-size:12px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:black;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Times New Roman"
-         xml:space="preserve"><tspan
-           style="text-align:start;text-anchor:start"
-           id="tspan3013"
-           y="397.51538"
-           x="262.15436"
-           sodipodi:role="line">common history</tspan></text>
-      <g
-         id="g3107">
-        <path
-           style="fill:black;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;marker-end:url(#Arrow1Mend);stroke-miterlimit:4;stroke-dasharray:4, 4;stroke-dashoffset:0;stroke-opacity:1"
-           d="M 300.35713,381.29075 L 300.35713,304.50504"
-           id="path3101" />
-        <path
-           style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#bfbfbf;stroke-width:0.60000002;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
-           d="M 291.07142,301.64789 L 309.28571,301.64789"
-           id="path3105" />
-      </g>
-      <g
-         transform="matrix(1,0,0,-1,0.178583,789.2886)"
-         id="g3111">
-        <path
-           style="fill:black;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;marker-end:url(#Arrow1Mend);stroke-miterlimit:4;stroke-dasharray:4, 4;stroke-dashoffset:0;stroke-opacity:1"
-           d="M 300.35713,381.29075 L 300.35713,304.50504"
-           id="path3113" />
-        <path
-           style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#bfbfbf;stroke-width:0.60000002;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
-           d="M 291.07142,301.64789 L 309.28571,301.64789"
-           id="path3115" />
-      </g>
+      <path
+         id="path3101"
+         d="M 300.35713,381.29075 L 300.35713,304.50504"
+         style="fill:black;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;marker-end:url(#Arrow1Mend);stroke-miterlimit:4;stroke-dasharray:4, 4;stroke-dashoffset:0;stroke-opacity:1" />
+      <path
+         id="path3105"
+         d="M 291.07142,301.64789 L 309.28571,301.64789"
+         style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#bfbfbf;stroke-width:0.60000002;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
     </g>
+    <path
+       style="fill:black;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;marker-end:url(#Arrow1Mend);stroke-miterlimit:4;stroke-dasharray:4, 4;stroke-dashoffset:0;stroke-opacity:1"
+       d="M 300.53571,486.38926 L 300.53571,409.60355"
+       id="path3113" />
+    <path
+       style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#bfbfbf;stroke-width:0.60000002;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       d="M 291.25,488.49641 L 309.46429,488.49641"
+       id="path3115" />
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:black;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Times New Roman"
+       x="480.71429"
+       y="250.91507"
+       id="text1949"><tspan
+         sodipodi:role="line"
+         id="tspan1951"
+         x="480.71429"
+         y="250.91507"
+         style="text-align:start;text-anchor:start">head revision</tspan><tspan
+         sodipodi:role="line"
+         x="480.71429"
+         y="265.91507"
+         id="tspan1953"
+         style="text-align:start;text-anchor:start">(has no children)</tspan></text>
   </g>
 </svg>

en/tour-merge.tex

 in it.
 \interaction{tour.merge.clone}
 We should now have two copies of \filename{hello.c} with different
-contents.
+contents.  The histories of the two repositories have also diverged,
+as illustrated in figure~\ref{fig:tour-merge:sep-repos}.
 \interaction{tour.merge.cat}
 
+\begin{figure}[ht]
+  \centering
+  \grafix{tour-merge-sep-repos}
+  \caption{Divergent recent histories of the \dirname{my-hello} and
+    \dirname{my-new-hello} repositories}
+  \label{fig:tour-merge:sep-repos}
+\end{figure}
+
 We already know that pulling changes from our \dirname{my-hello}
 repository will have no effect on the working directory.
 \interaction{tour.merge.pull}
 However, the \hgcmd{pull} command says something about ``heads''.  
 
-A head is a change that has no descendants.  The tip revision is thus
-a head, but a repository can contain more than one head.  We can view
-them using the \hgcmd{heads} command.
+A head is a change that has no descendants, or children, as they're
+also known.  The tip revision is thus a head, because the newest
+revision in a repository doesn't have any children, but a repository
+can contain more than one head.
+
+\begin{figure}[ht]
+  \centering
+  \grafix{tour-merge-pull}
+  \caption{Repository contents after pulling from \dirname{my-hello} into
+    \dirname{my-new-hello}}
+  \label{fig:tour-merge:pull}
+\end{figure}
+
+In figure~\ref{fig:tour-merge:pull}, you can see the effect of the
+pull from \dirname{my-hello} into \dirname{my-new-hello}.  The history
+that was already present in \dirname{my-new-hello} is untouched, but a
+new revision has been added.  By referring to
+figure~\ref{fig:tour-merge:sep-repos}, we can see that the
+\emph{changeset ID} remains the same in the new repository, but the
+\emph{revision number} has changed.  (This, incidentally, is a fine
+example of why it's not safe to use revision numbers when discussing
+changesets.)  We can view the heads in a repository using the
+\hgcmd{heads} command.
 \interaction{tour.merge.heads}
 What happens if we try to use the normal \hgcmd{update} command to
 update to the new tip?