hgbook
diff en/tour.tex @ 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 |
line diff
1.1 --- a/en/tour.tex Thu Oct 12 16:01:40 2006 -0700 1.2 +++ b/en/tour.tex Thu Oct 12 16:15:16 2006 -0700 1.3 @@ -434,11 +434,11 @@ 1.4 \interaction{tour.pull} 1.5 As you can see from the before-and-after output of \hgcmd{tip}, we 1.6 have successfully pulled changes into our repository. There remains 1.7 -one step before we can work with those changes. 1.8 - 1.9 -\section{Updating the working directory} 1.10 - 1.11 -We have so far glossed over the relatioship between a repository and 1.12 +one step before we can see these changes in the working directory. 1.13 + 1.14 +\subsection{Updating the working directory} 1.15 + 1.16 +We have so far glossed over the relationship between a repository and 1.17 its working directory. The \hgcmd{pull} command that we ran in 1.18 section~\ref{sec:tour:pull} brought changes into the repository, but 1.19 if we check, there's no sign of those changes in the working 1.20 @@ -462,6 +462,13 @@ 1.21 \begin{codesample2} 1.22 hg pull -u 1.23 \end{codesample2} 1.24 +If you look back at the output of \hgcmd{pull} in 1.25 +section~\ref{sec:tour:pull} when we ran it without \hgopt{pull}{-u}, 1.26 +you can see that it printed a helpful reminder that we'd have to take 1.27 +an explicit step to update the working directory: 1.28 +\begin{codesample2} 1.29 + (run 'hg update' to get a working copy) 1.30 +\end{codesample2} 1.31 1.32 To find out what revision the working directory is at, use the 1.33 \hgcmd{parents} command. 1.34 @@ -472,6 +479,27 @@ 1.35 If you omit an explicit revision, \hgcmd{update} will update to the 1.36 tip revision. 1.37 1.38 +\subsection{Pushing changes to another repository} 1.39 + 1.40 +Mercurial lets us push changes to another repository, from the 1.41 +repository we're currently visiting. As with the example of 1.42 +\hgcmd{pull} above, we'll create a temporary repository to push our 1.43 +changes into. 1.44 +\interaction{tour.clone-push} 1.45 +The \hgcmd{outgoing} command tells us what changes would be pushed 1.46 +into another repository. 1.47 +\interaction{tour.outgoing} 1.48 +And the \hgcmd{push} command does the actual push. 1.49 +\interaction{tour.push} 1.50 +As with \hgcmd{pull}, the \hgcmd{push} command does not update the 1.51 +working directory in the repository that it's pushing changes into. 1.52 +(Unlike \hgcmd{pull}, \hgcmd{push} does not provide a \texttt{-u} 1.53 +option that updates the other repository's working directory.) 1.54 + 1.55 +What happens if we try to pull or push changes and the receiving 1.56 +repository already has those changes? Nothing too exciting. 1.57 +\interaction{tour.push.nothing} 1.58 + 1.59 %%% Local Variables: 1.60 %%% mode: latex 1.61 %%% TeX-master: "00book"