1. Bryan O'Sullivan
  2. hgbook


Bryan O'Sullivan  committed 72d2079

Tour: push.

  • Participants
  • Parent commits 7524d52
  • Branches default

Comments (0)

Files changed (2)

File en/examples/tour

View file
  • Ignore whitespace
 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

File en/tour.tex

View file
  • Ignore whitespace
 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
   hg pull -u
+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:
+  (run 'hg update' to get a working copy)
 To find out what revision the working directory is at, use the
 \hgcmd{parents} command.
 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.
+The \hgcmd{outgoing} command tells us what changes would be pushed
+into another repository.
+And the \hgcmd{push} command does the actual 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.
 %%% Local Variables: 
 %%% mode: latex
 %%% TeX-master: "00book"