comparison en/tour-merge.tex @ 99:06383f9e46e4

More graphics.
author Bryan O'Sullivan <bos@serpentine.com>
date Mon, 16 Oct 2006 14:54:37 -0700
parents 47ea206351d5
children 272146fab009
comparison
equal deleted inserted replaced
98:3f3dd60695cb 99:06383f9e46e4
25 it easy. Let's walk through the process. We'll begin by cloning yet 25 it easy. Let's walk through the process. We'll begin by cloning yet
26 another repository (see how often they spring up?) and making a change 26 another repository (see how often they spring up?) and making a change
27 in it. 27 in it.
28 \interaction{tour.merge.clone} 28 \interaction{tour.merge.clone}
29 We should now have two copies of \filename{hello.c} with different 29 We should now have two copies of \filename{hello.c} with different
30 contents. 30 contents. The histories of the two repositories have also diverged,
31 as illustrated in figure~\ref{fig:tour-merge:sep-repos}.
31 \interaction{tour.merge.cat} 32 \interaction{tour.merge.cat}
33
34 \begin{figure}[ht]
35 \centering
36 \grafix{tour-merge-sep-repos}
37 \caption{Divergent recent histories of the \dirname{my-hello} and
38 \dirname{my-new-hello} repositories}
39 \label{fig:tour-merge:sep-repos}
40 \end{figure}
32 41
33 We already know that pulling changes from our \dirname{my-hello} 42 We already know that pulling changes from our \dirname{my-hello}
34 repository will have no effect on the working directory. 43 repository will have no effect on the working directory.
35 \interaction{tour.merge.pull} 44 \interaction{tour.merge.pull}
36 However, the \hgcmd{pull} command says something about ``heads''. 45 However, the \hgcmd{pull} command says something about ``heads''.
37 46
38 A head is a change that has no descendants. The tip revision is thus 47 A head is a change that has no descendants, or children, as they're
39 a head, but a repository can contain more than one head. We can view 48 also known. The tip revision is thus a head, because the newest
40 them using the \hgcmd{heads} command. 49 revision in a repository doesn't have any children, but a repository
50 can contain more than one head.
51
52 \begin{figure}[ht]
53 \centering
54 \grafix{tour-merge-pull}
55 \caption{Repository contents after pulling from \dirname{my-hello} into
56 \dirname{my-new-hello}}
57 \label{fig:tour-merge:pull}
58 \end{figure}
59
60 In figure~\ref{fig:tour-merge:pull}, you can see the effect of the
61 pull from \dirname{my-hello} into \dirname{my-new-hello}. The history
62 that was already present in \dirname{my-new-hello} is untouched, but a
63 new revision has been added. By referring to
64 figure~\ref{fig:tour-merge:sep-repos}, we can see that the
65 \emph{changeset ID} remains the same in the new repository, but the
66 \emph{revision number} has changed. (This, incidentally, is a fine
67 example of why it's not safe to use revision numbers when discussing
68 changesets.) We can view the heads in a repository using the
69 \hgcmd{heads} command.
41 \interaction{tour.merge.heads} 70 \interaction{tour.merge.heads}
42 What happens if we try to use the normal \hgcmd{update} command to 71 What happens if we try to use the normal \hgcmd{update} command to
43 update to the new tip? 72 update to the new tip?
44 \interaction{tour.merge.update} 73 \interaction{tour.merge.update}
45 Mercurial is telling us that the \hgcmd{update} command won't do a 74 Mercurial is telling us that the \hgcmd{update} command won't do a