# HG changeset patch # User Bryan O'Sullivan # Date 1160694916 25200 # Node ID 72d207927dc4932d857dafa380463439a44a70df # Parent 7524d52d957763688a46d76a928384692a2c1093 Tour: push. diff -r 7524d52d9577 -r 72d207927dc4 en/examples/tour --- 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 diff -r 7524d52d9577 -r 72d207927dc4 en/tour.tex --- 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. - -\section{Updating the working directory} - -We have so far glossed over the relatioship between a repository and +one step before we can see these changes in the working directory. + +\subsection{Updating the working directory} + +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"