hgbook
changeset 92:72d207927dc4
Tour: push.
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Thu Oct 12 16:15:16 2006 -0700 (2006-10-12) |
parents | 7524d52d9577 |
children | 97638d862ef3 |
files | en/examples/tour en/tour.tex |
line diff
1.1 --- a/en/examples/tour Thu Oct 12 16:01:40 2006 -0700 1.2 +++ b/en/examples/tour Thu Oct 12 16:15:16 2006 -0700 1.3 @@ -105,3 +105,21 @@ 1.4 1.5 hg update 2 1.6 hg parents 1.7 + 1.8 +#$ name: clone-push 1.9 + 1.10 +cd .. 1.11 +hg clone hello hello-push 1.12 + 1.13 +#$ name: outgoing 1.14 + 1.15 +cd my-hello 1.16 +hg outgoing ../hello-push 1.17 + 1.18 +#$ name: push 1.19 + 1.20 +hg push ../hello-push 1.21 + 1.22 +#$ name: push.nothing 1.23 + 1.24 +hg push ../hello-push
2.1 --- a/en/tour.tex Thu Oct 12 16:01:40 2006 -0700 2.2 +++ b/en/tour.tex Thu Oct 12 16:15:16 2006 -0700 2.3 @@ -434,11 +434,11 @@ 2.4 \interaction{tour.pull} 2.5 As you can see from the before-and-after output of \hgcmd{tip}, we 2.6 have successfully pulled changes into our repository. There remains 2.7 -one step before we can work with those changes. 2.8 - 2.9 -\section{Updating the working directory} 2.10 - 2.11 -We have so far glossed over the relatioship between a repository and 2.12 +one step before we can see these changes in the working directory. 2.13 + 2.14 +\subsection{Updating the working directory} 2.15 + 2.16 +We have so far glossed over the relationship between a repository and 2.17 its working directory. The \hgcmd{pull} command that we ran in 2.18 section~\ref{sec:tour:pull} brought changes into the repository, but 2.19 if we check, there's no sign of those changes in the working 2.20 @@ -462,6 +462,13 @@ 2.21 \begin{codesample2} 2.22 hg pull -u 2.23 \end{codesample2} 2.24 +If you look back at the output of \hgcmd{pull} in 2.25 +section~\ref{sec:tour:pull} when we ran it without \hgopt{pull}{-u}, 2.26 +you can see that it printed a helpful reminder that we'd have to take 2.27 +an explicit step to update the working directory: 2.28 +\begin{codesample2} 2.29 + (run 'hg update' to get a working copy) 2.30 +\end{codesample2} 2.31 2.32 To find out what revision the working directory is at, use the 2.33 \hgcmd{parents} command. 2.34 @@ -472,6 +479,27 @@ 2.35 If you omit an explicit revision, \hgcmd{update} will update to the 2.36 tip revision. 2.37 2.38 +\subsection{Pushing changes to another repository} 2.39 + 2.40 +Mercurial lets us push changes to another repository, from the 2.41 +repository we're currently visiting. As with the example of 2.42 +\hgcmd{pull} above, we'll create a temporary repository to push our 2.43 +changes into. 2.44 +\interaction{tour.clone-push} 2.45 +The \hgcmd{outgoing} command tells us what changes would be pushed 2.46 +into another repository. 2.47 +\interaction{tour.outgoing} 2.48 +And the \hgcmd{push} command does the actual push. 2.49 +\interaction{tour.push} 2.50 +As with \hgcmd{pull}, the \hgcmd{push} command does not update the 2.51 +working directory in the repository that it's pushing changes into. 2.52 +(Unlike \hgcmd{pull}, \hgcmd{push} does not provide a \texttt{-u} 2.53 +option that updates the other repository's working directory.) 2.54 + 2.55 +What happens if we try to pull or push changes and the receiving 2.56 +repository already has those changes? Nothing too exciting. 2.57 +\interaction{tour.push.nothing} 2.58 + 2.59 %%% Local Variables: 2.60 %%% mode: latex 2.61 %%% TeX-master: "00book"