changeset 92:72d207927dc4

Tour: push.
author Bryan O'Sullivan <bos@serpentine.com>
date Thu, 12 Oct 2006 16:15:16 -0700
parents 7524d52d9577
children 97638d862ef3
files en/examples/tour en/tour.tex
diffstat 2 files changed, 49 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/en/examples/tour	Thu Oct 12 16:01:40 2006 -0700
+++ b/en/examples/tour	Thu Oct 12 16:15:16 2006 -0700
@@ -105,3 +105,21 @@
 
 hg update 2
 hg parents
+
+#$ name: clone-push
+
+cd ..
+hg clone hello hello-push
+
+#$ name: outgoing
+
+cd my-hello
+hg outgoing ../hello-push
+
+#$ name: push
+
+hg push ../hello-push
+
+#$ name: push.nothing
+
+hg push ../hello-push
--- a/en/tour.tex	Thu Oct 12 16:01:40 2006 -0700
+++ b/en/tour.tex	Thu Oct 12 16:15:16 2006 -0700
@@ -434,11 +434,11 @@
 \interaction{tour.pull}
 As you can see from the before-and-after output of \hgcmd{tip}, we
 have successfully pulled changes into our repository.  There remains
-one step before we can work with those changes.
+one step before we can see these changes in the working directory.
 
-\section{Updating the working directory}
+\subsection{Updating the working directory}
 
-We have so far glossed over the relatioship between a repository and
+We have so far glossed over the relationship between a repository and
 its working directory.  The \hgcmd{pull} command that we ran in
 section~\ref{sec:tour:pull} brought changes into the repository, but
 if we check, there's no sign of those changes in the working
@@ -462,6 +462,13 @@
 \begin{codesample2}
   hg pull -u
 \end{codesample2}
+If you look back at the output of \hgcmd{pull} in
+section~\ref{sec:tour:pull} when we ran it without \hgopt{pull}{-u},
+you can see that it printed a helpful reminder that we'd have to take
+an explicit step to update the working directory:
+\begin{codesample2}
+  (run 'hg update' to get a working copy)
+\end{codesample2}
 
 To find out what revision the working directory is at, use the
 \hgcmd{parents} command.
@@ -472,6 +479,27 @@
 If you omit an explicit revision, \hgcmd{update} will update to the
 tip revision.
 
+\subsection{Pushing changes to another repository}
+
+Mercurial lets us push changes to another repository, from the
+repository we're currently visiting.  As with the example of
+\hgcmd{pull} above, we'll create a temporary repository to push our
+changes into.
+\interaction{tour.clone-push}
+The \hgcmd{outgoing} command tells us what changes would be pushed
+into another repository.
+\interaction{tour.outgoing}
+And the \hgcmd{push} command does the actual push.
+\interaction{tour.push}
+As with \hgcmd{pull}, the \hgcmd{push} command does not update the
+working directory in the repository that it's pushing changes into.
+(Unlike \hgcmd{pull}, \hgcmd{push} does not provide a \texttt{-u}
+option that updates the other repository's working directory.)
+
+What happens if we try to pull or push changes and the receiving
+repository already has those changes?  Nothing too exciting.
+\interaction{tour.push.nothing}
+
 %%% Local Variables: 
 %%% mode: latex
 %%% TeX-master: "00book"