comparison ja/tour-basic.tex @ 797:a958bf6d87ed

Propagate c44d5854620b Fix up chapter 1.
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Thu, 18 Jun 2009 16:43:10 +0900
parents 72eab2497e12
children 09c1609f9bb2
comparison
equal deleted inserted replaced
796:5cb09396dc35 797:a958bf6d87ed
12 12
13 $B?M5$$N9b$$%*%Z%l!<%F%#%s%0%7%9%F%`$G$O(BMercurial$B$N%S%k%I:Q$_%P%$%J%j%Q%C(B 13 $B?M5$$N9b$$%*%Z%l!<%F%#%s%0%7%9%F%`$G$O(BMercurial$B$N%S%k%I:Q$_%P%$%J%j%Q%C(B
14 $B%1!<%8$,Ds6!$5$l$F$$$k!%$3$l$rMQ$$$l$PFI<T$N7W;;5!$N>e$GD>$A$K(BMercurial 14 $B%1!<%8$,Ds6!$5$l$F$$$k!%$3$l$rMQ$$$l$PFI<T$N7W;;5!$N>e$GD>$A$K(BMercurial
15 $B$r;H$&$3$H$,$G$-$k!%(B 15 $B$r;H$&$3$H$,$G$-$k!%(B
16 16
17 \subsection{Windows}
18
19 %The best version of Mercurial for Windows is TortoiseHg, which can be
20 %found at \url{http://bitbucket.org/tortoisehg/stable/wiki/Home}. This
21 %package has no external dependencies; it ``just works''. It
22 %provides both command line and graphical user interfaces.
23
24 Windows$B8~$1(BMercurial$B$N:G$bM%$l$?%P!<%8%g%s$G$"$k(BTortoiseHg$B$O!$(B
25 \url{http://bitbucket.org/tortoisehg/stable/wiki/Home}$B$GF~<j$G$-$k!%(B
26 $B$3$N%Q%C%1!<%8$O30It$N%Q%C%1!<%8$X0MB8$;$:!$$9$0$KF0:n$9$k!%%3%^%s%I%i%$(B
27 $B%s%$%s%?%U%'!<%9$H%0%i%U%#%+%k%f!<%6%$%s%?%U%'!<%9$NN>J}$,MxMQ$G$-$k!%(B
28
29 \subsection{Mac OS X}
30
31 %Lee Cantey publishes an installer of Mercurial for Mac OS X at
32 % \url{http://mercurial.berkwood.com}.
33
34 Lee Cantey$B$O(BMac OS~X$B8~$1$N(BMercurial$B%$%s%9%H!<%i$r(B
35 \url{http://mercurial.berkwood.com}$B$GG[I[$7$F$$$k!%(B
36
17 \subsection{Linux} 37 \subsection{Linux}
18
19 %Because each Linux distribution has its own packaging tools, policies, 38 %Because each Linux distribution has its own packaging tools, policies,
20 %and rate of development, it's difficult to give a comprehensive set of 39 %and rate of development, it's difficult to give a comprehensive set of
21 %instructions on how to install Mercurial binaries. The version of 40 %instructions on how to install Mercurial binaries. The version of
22 %Mercurial that you will end up with can vary depending on how active 41 %Mercurial that you will end up with can vary depending on how active
23 %the person is who maintains the package for your distribution. 42 %the person is who maintains the package for your distribution.
37 Mercurial$B$r%$%s%9%H!<%k$9$kJ}K!$K8BDj$7$F@bL@$9$k$3$H$K$9$k!%$3$l$i$NBgH>(B 56 Mercurial$B$r%$%s%9%H!<%k$9$kJ}K!$K8BDj$7$F@bL@$9$k$3$H$K$9$k!%$3$l$i$NBgH>(B
38 $B$N%G%#%9%H%j%S%e!<%7%g%s$G$O!$(BMercurial$B$r%/%j%C%/(B1$B2s$G%$%s%9%H!<%k$G$-$k(B 57 $B$N%G%#%9%H%j%S%e!<%7%g%s$G$O!$(BMercurial$B$r%/%j%C%/(B1$B2s$G%$%s%9%H!<%k$G$-$k(B
39 $B$h$&$J%0%i%U%#%+%k$J%Q%C%1!<%8%^%M!<%8%c$rMQ0U$7$F$$$k!%(B 58 $B$h$&$J%0%i%U%#%+%k$J%Q%C%1!<%8%^%M!<%8%c$rMQ0U$7$F$$$k!%(B
40 59
41 \begin{itemize} 60 \begin{itemize}
42 \item[Debian] 61 \item[Debian and Ubuntu]
43 \begin{codesample4} 62 \begin{codesample4}
44 apt-get install mercurial 63 apt-get install mercurial
45 \end{codesample4} 64 \end{codesample4}
46 65
47 \item[Fedora Core] 66 \item[Fedora and OpenSUSE]
48 \begin{codesample4} 67 \begin{codesample4}
49 yum install mercurial 68 yum install mercurial
50 \end{codesample4} 69 \end{codesample4}
51 70
52 \item[Gentoo] 71 \item[Gentoo]
53 \begin{codesample4} 72 \begin{codesample4}
54 emerge mercurial 73 emerge mercurial
55 \end{codesample4} 74 \end{codesample4}
56 75
57 \item[OpenSUSE]
58 \begin{codesample4}
59 yum install mercurial
60 \end{codesample4}
61
62 %\item[Ubuntu] Ubuntu's Mercurial package is based on Debian's. To
63 % install it, run the following command.
64 \item[Ubuntu] Ubuntu$B$N(BMercurial package$B$O(BDebian$B$N$b$N$r85$K$7$F$$$k!%$3(B
65 $B$l$r%$%s%9%H!<%k$9$k$?$a$K$O<!$N%3%^%s%I$r<B9T$9$k!%(B
66 \begin{codesample4}
67 apt-get install mercurial
68 \end{codesample4}
69 % The Ubuntu package for Mercurial tends to lag behind the Debian 76 % The Ubuntu package for Mercurial tends to lag behind the Debian
70 % version by a considerable time margin (at the time of writing, seven 77 % version by a considerable time margin (at the time of writing, seven
71 % months), which in some cases will mean that on Ubuntu, you may run 78 % months), which in some cases will mean that on Ubuntu, you may run
72 % into problems that have since been fixed in the Debian package. 79 % into problems that have since been fixed in the Debian package.
73 Ubuntu$B$N(BMercurial$B%Q%C%1!<%8$O(BDebian$B$N$b$N$KHf$Y$FL5;k$G$-$J$$$[$I$NCY$l(B 80 Ubuntu$B$N(BMercurial$B%Q%C%1!<%8$O(BDebian$B$N$b$N$KHf$Y$FL5;k$G$-$J$$$[$I$NCY$l(B
75 $B$O(BDebian$B$G$O$9$G$K2r7h$5$l$?LdBj$KD>LL$9$k$+$b$7$l$J$$!%(B 82 $B$O(BDebian$B$G$O$9$G$K2r7h$5$l$?LdBj$KD>LL$9$k$+$b$7$l$J$$!%(B
76 \end{itemize} 83 \end{itemize}
77 84
78 \subsection{Solaris} 85 \subsection{Solaris}
79 86
80 %SunFreeWare, at \url{http://www.sunfreeware.com}, is a good source for a 87 %SunFreeWare, at \url{http://www.sunfreeware.com}, provides prebuilt
81 %large number of pre-built Solaris packages for 32 and 64 bit Intel and 88 %packages of Mercurial.
82 %Sparc architectures, including current versions of Mercurial. 89 \url{http://www.sunfreeware.com}$B$+$i%S%k%I:Q$_$N(BMercurial$B%Q%C%1!<%8$,F~(B
83 90 $B<j$G$-$k!%(B
84 \url{http://www.sunfreeware.com}$B$K$"$k(BSunFreeWare$B$O!$8=9T$N(BMercurial$B$r4^(B
85 $B$`!$(B32$B%S%C%H5Z$S(B64$B%S%C%H$N(BIntel$B$H(BSparc$B%"!<%-%F%/%A%cMQ$K%S%k%I$5$l$?(B
86 Solaris$B%Q%C%1!<%8$NBg5,LO$J%3%l%/%7%g%s$G$"$k!%(B
87
88 \subsection{Mac OS X}
89
90 %Lee Cantey publishes an installer of Mercurial for Mac OS~X at
91 %\url{http://mercurial.berkwood.com}. This package works on both
92 %Intel-~and Power-based Macs. Before you can use it, you must install
93 %a compatible version of Universal MacPython~\cite{web:macpython}. This
94 %is easy to do; simply follow the instructions on Lee's site.
95
96 Lee Cantey$B$O(BMac OS~X$B8~$1$N(BMercurial$B%$%s%9%H!<%i$r(B
97 \url{http://mercurial.berkwood.com}$B$GG[I[$7$F$$$k!%$3$N%Q%C%1!<%8$O(B
98 Intel-~$B$H(BPower-$B%Y!<%9$N(BMac$BN>J}$GF0:n$9$k!%$3$l$r;H$&A0$K!$8_49@-$N$"$k%P!<(B
99 $B%8%g%s$N(BUniversal MacPython~\cite{web:macpython}$B$r%$%s%9%H!<%k$9$kI,MW$,(B
100 $B$"$k!%%$%s%9%H!<%k$O4JC1$G!$(BLee$B$N%5%$%H$K$"$k<j=g$K=>$&$@$1$G$"$k!%(B
101
102 \subsection{Windows}
103
104 %Lee Cantey also publishes an installer of Mercurial for Windows at
105 %\url{http://mercurial.berkwood.com}. This package has no external
106 %dependencies; it ``just works''.
107
108 Lee Cantey$B$O(BWindows$B8~$1$N(BMercurial$B%$%s%9%H!<%i$b(B
109 \url{http://mercurial.berkwood.com}$B$GG[I[$7$F$$$k!%$3$N%Q%C%1!<%8$O30It(B
110 $B$N%=%U%H%&%'%"$K0MB8$;$:!$C1FH$G<B9T2DG=$G$"$k!%(B
111
112 \begin{note}
113 % The Windows version of Mercurial does not automatically convert line
114 % endings between Windows and Unix styles. If you want to share work
115 % with Unix users, you must do a little additional configuration
116 % work. XXX Flesh this out.
117 Windows$B%P!<%8%g%s$N(BMercurial$B$O!$(BWindows$B$H(BUnix$B$N4V$G9TKv$N2~9T%3!<%I$r<+(B
118 $BF0$GJQ49$7$J$$!%(BUnix$B%f!<%6$H:n6H$r9T$$$?$$>l9g$O!$DI2C$N@_Dj$r9T$&I,MW(B
119 $B$,$"$k!%(BXXX Flesh this out.
120 \end{note}
121 91
122 %\section{Getting started} 92 %\section{Getting started}
123 \section{Mercurial$B$r;H$&(B} 93 \section{Mercurial$B$r;H$&(B}
124 94
125 %To begin, we'll use the \hgcmd{version} command to find out whether 95 %To begin, we'll use the \hgcmd{version} command to find out whether
182 \subsection{$B%j%]%8%H%j$N%m!<%+%k%3%T!<$r:n$k(B} 152 \subsection{$B%j%]%8%H%j$N%m!<%+%k%3%T!<$r:n$k(B}
183 153
184 %\emph{Copying} a repository is just a little bit special. While you 154 %\emph{Copying} a repository is just a little bit special. While you
185 %could use a normal file copying command to make a copy of a 155 %could use a normal file copying command to make a copy of a
186 %repository, it's best to use a built-in command that Mercurial 156 %repository, it's best to use a built-in command that Mercurial
187 %provides. This command is called \hgcmd{clone}, because it creates an 157 %provides. This command is called \hgcmd{clone}, because it makes an
188 %identical copy of an existing repository. 158 %identical copy of an existing repository.
189 %\interaction{tour.clone} 159 %\interaction{tour.clone}
160
161 $B%j%]%8%H%j$N(B\emph{$B%3%T!<(B}$B$O$d$dFC<l$G$"$k!%DL>o$N%U%!%$%k%3%T!<%3%^%s%I$r(B
162 $B;H$C$F%j%]%8%H%j$N%3%T!<$r:n@.$9$k$3$H$b$G$-$k$,!$(BMercurial$B$NAH$_9~$_%3%^(B
163 $B%s%I$r;H$C$F%3%T!<$9$k$N$,0lHVNI$$!%$3$N%3%^%s%I$O(B\hgcmd{clone}$B$H8F$P$l!$(B
164 $B4{B8$N%j%]%8%H%j$N40A4$J%3%T!<$r:n@.$9$k!%(B
165 \interaction{tour.clone}
166
167 %One advantage of using \hgcmd{clone} is that, as we can see above, it
168 %lets us clone repositories over the network. Another is that it
169 %remembers where we cloned from, which we'll find useful soon when we
170 %want to fetch new changes from another repository.
171
172 \hgcmd{clone}$B%3%^%s%I$r;H$&MxE@$N0l$D$O!$>e$G8+$?$h$&$K%j%]%8%H%j$r%M%C%H(B
173 $B%o!<%/1[$7$K%/%m!<%s$G$-$kE@$G$"$k!%$^$?$b$&0lE@!$$3$N%3%^%s%I$O$I$3$+$i(B
174 $B%/%m!<%s$7$?$N$+$r5-O?$9$k$?$a!$?7$?$JJQ99$rJL$N%j%]%8%H%j$+$i<hF@$7$h$&(B
175 $B$H$9$k:]$KJXMx$G$"$k!%(B
176
190 %If our clone succeeded, we should now have a local directory called 177 %If our clone succeeded, we should now have a local directory called
191 %\dirname{hello}. This directory will contain some files. 178 %\dirname{hello}. This directory will contain some files.
192 %\interaction{tour.ls} 179 %\interaction{tour.ls}
193 %These files have the same contents and history in our repository as 180 %These files have the same contents and history in our repository as
194 %they do in the repository we cloned. 181 %they do in the repository we cloned.
195 182
196 $B%j%]%8%H%j$N(B\emph{$B%3%T!<(B}$B$O$d$dFC<l$G$"$k!%DL>o$N%U%!%$%k%3%T!<%3%^%s%I$r(B
197 $B;H$C$F%j%]%8%H%j$N%3%T!<$r:n@.$9$k$3$H$b$G$-$k$,!$(BMercurial$B$NAH$_9~$_%3%^(B
198 $B%s%I$r;H$C$F%3%T!<$9$k$N$,0lHVNI$$!%$3$N%3%^%s%I$O(B\hgcmd{clone}$B$H8F$P$l!$(B
199 $B4{B8$N%j%]%8%H%j$N40A4$J%3%T!<$r:n@.$9$k!%(B
200 \interaction{tour.clone}
201 $B%/%m!<%s$,@.8y$9$k$H(B\dirname{hello}$B$H$$$&%m!<%+%k%G%#%l%/%H%j$,$G$-$k!%(B 183 $B%/%m!<%s$,@.8y$9$k$H(B\dirname{hello}$B$H$$$&%m!<%+%k%G%#%l%/%H%j$,$G$-$k!%(B
202 $B$3$N%G%#%l%/%H%j$K$O%*%j%8%J%k$HF10l$N%U%!%$%k$,4^$^$l$k!%(B 184 $B$3$N%G%#%l%/%H%j$K$O%*%j%8%J%k$HF10l$N%U%!%$%k$,4^$^$l$k!%(B
203 \interaction{tour.ls} 185 \interaction{tour.ls}
204 $B$3$l$i$N%U%!%$%k$O%/%m!<%s$7$?%j%]%8%H%jFb$HA4$/F1$8FbMF$HMzNr$r;}$C$F$$(B 186 $B$3$l$i$N%U%!%$%k$O%/%m!<%s$7$?%j%]%8%H%jFb$HA4$/F1$8FbMF$HMzNr$r;}$C$F$$(B
205 $B$k!%(B 187 $B$k!%(B
206 188
207 %Every Mercurial repository is complete, self-contained, and 189 %Every Mercurial repository is complete, self-contained, and independent.
208 %independent. It contains its own private copy of a project's files 190 %It contains its own private copy of a project's files and history. As we
209 %and history. A cloned repository remembers the location of the 191 %just mentioned, A cloned repository remembers the location of the
210 %repository it was cloned from, but it does not communicate with that 192 %repository it was cloned from, but it does not communicate with that
211 %repository, or any other, unless you tell it to. 193 %repository, or any other, unless you tell it to.
212 194
213 $BA4$F$N(BMercurial$B%j%]%8%H%j$O40A4$+$D<+8J=<B-E*$GFHN)$G$"$k!%%j%]%8%H%j$O%W(B 195 $BA4$F$N(BMercurial$B%j%]%8%H%j$O40A4$+$D<+8J=<B-E*$GFHN)$G$"$k!%%j%]%8%H%j$O%W(B
214 $B%m%8%'%/%H$KB0$9%U%!%$%k$N%W%i%$%Y!<%H%3%T!<$HMzNr$r;}$D!%%/%m!<%s$5$l$?(B 196 $B%m%8%'%/%H$KB0$9%U%!%$%k$N%W%i%$%Y!<%H%3%T!<$HMzNr$r;}$D!%:#=R$Y$?$h$&(B
215 $B%j%]%8%H%j$O%/%m!<%s85$N%j%]%8%H%j$N>l=j$r5-21$7$F$$$k$,!$%f!<%6$,;X<($7(B 197 $B$K!$%/%m!<%s$5$l$?%j%]%8%H%j$O%/%m!<%s85$N%j%]%8%H%j$N>l=j$r5-21$7$F$$$k(B
216 $B$J$$8B$j!$$=$N%j%]%8%H%j$dB>$N%j%]%8%H%j$HDL?.$r9T$&$3$H$O$J$$!%(B 198 $B$,!$%f!<%6$,;X<($7$J$$8B$j!$$=$N%j%]%8%H%j$dB>$N%j%]%8%H%j$HDL?.$r9T$&$3(B
199 $B$H$O$J$$!%(B
217 200
218 %What this means for now is that we're free to experiment with our 201 %What this means for now is that we're free to experiment with our
219 %repository, safe in the knowledge that it's a private ``sandbox'' that 202 %repository, safe in the knowledge that it's a private ``sandbox'' that
220 %won't affect anyone else. 203 %won't affect anyone else.
221 204
262 %\section{A tour through history} 245 %\section{A tour through history}
263 \section{$BMzNr$rC)$k(B} 246 \section{$BMzNr$rC)$k(B}
264 247
265 %One of the first things we might want to do with a new, unfamiliar 248 %One of the first things we might want to do with a new, unfamiliar
266 %repository is understand its history. The \hgcmd{log} command gives 249 %repository is understand its history. The \hgcmd{log} command gives
267 %us a view of history. 250 %us a view of the history of changes in the repository.
268 %\interaction{tour.log} 251 %\interaction{tour.log}
269 %By default, this command prints a brief paragraph of output for each 252 %By default, this command prints a brief paragraph of output for each
270 %change to the project that was recorded. In Mercurial terminology, we 253 %change to the project that was recorded. In Mercurial terminology, we
271 %call each of these recorded events a \emph{changeset}, because it can 254 %call each of these recorded events a \emph{changeset}, because it can
272 %contain a record of changes to several files. 255 %contain a record of changes to several files.
273 256
274 $BL$CN$N%j%]%8%H%j$KBP$7$F$^$:$7$h$&$H;W$&$3$H$O!$$=$NMzNr$rCN$k$3$H$@$m$&!%(B 257 $BL$CN$N%j%]%8%H%j$KBP$7$F$^$:$7$h$&$H;W$&$3$H$O!$$=$N%j%]%8%H%j$G$NJQ99$N(B
275 $BMzNr$O(B\hgcmd{log}$B%3%^%s%I$G8+$k$3$H$,$G$-$k!%(B 258 $BMzNr$rCN$k$3$H$@$m$&!%MzNr$O(B\hgcmd{log}$B%3%^%s%I$G8+$k$3$H$,$G$-$k!%(B
276 \interaction{tour.log} 259 \interaction{tour.log}
277 $B%G%U%)%k%H$G$O!$$3$N%3%^%s%I$O%W%m%8%'%/%H$KBP$7$F9T$o$l$?JQ99$N3F!9$K$D(B 260 $B%G%U%)%k%H$G$O!$$3$N%3%^%s%I$O%W%m%8%'%/%H$KBP$7$F9T$o$l$?JQ99$N3F!9$K$D(B
278 $B$$$F4J7i$J%Q%i%0%i%U$rI=<($9$k!%(B Mercurial$B$NMQ8l$G$O!$MzNrCf$NJQ99$N%$%Y(B 261 $B$$$F4J7i$J%Q%i%0%i%U$rI=<($9$k!%(B Mercurial$B$NMQ8l$G$O!$MzNrCf$NJQ99$N%$%Y(B
279 $B%s%H$r(B\emph{$B%A%'%s%8%;%C%H(B}$B$H8F$V!%$=$NM}M3$O!$J#?t$N%U%!%$%k$KBP$9$kJQ99(B 262 $B%s%H$r(B\emph{$B%A%'%s%8%;%C%H(B}$B$H8F$V!%$=$NM}M3$O!$J#?t$N%U%!%$%k$KBP$9$kJQ99(B
280 $B$N5-O?$r;}$AF@$k$+$i$G$"$k!%(B 263 $B$N5-O?$r;}$AF@$k$+$i$G$"$k!%(B
281 264
282 %The fields in a record of output from \hgcmd{log} are as follows. 265 %The fields in a record of output from \hgcmd{log} are as follows.
283 \hgcmd{log}$B$+$i=PNO$5$l$k5-O?$N3F%U%#!<%k%I$O<!$N$h$&$K$J$C$F$$$k!%(B 266 \hgcmd{log}$B$+$i=PNO$5$l$k5-O?$N3F%U%#!<%k%I$O<!$N$h$&$K$J$C$F$$$k!%(B
284 \begin{itemize} 267 \begin{itemize}
285 %\item[\texttt{changeset}] This field has the format of a number, 268 %\item[\texttt{changeset}] This field has the format of a number,
286 % followed by a colon, followed by a hexadecimal string. These are 269 % followed by a colon, followed by a hexadecimal (or
287 % \emph{identifiers} for the changeset. There are two identifiers 270 % \emph{hex}) string. These are \emph{identifiers} for the
288 % because the number is shorter and easier to type than the hex 271 % changeset. The hex string is a unique identifier: the same
289 % string. 272 % hex string will always refer to the same changeset. The
290 \item[\texttt{changeset}] $B?t;z!$$=$l$KB3$/%3%m%s$*$h$S(B16$B?JJ8;zNs!%$3$l$O(B 273 % number is shorter and easier to type than the hex string,
291 $B%A%'%s%8%;%C%H$N(B\emph{$B<1JL;R(B}$B$G$"$k!%?t;z$OC;$/F~NO$bMF0W$G(B 274 % but it isn't unique: the same number in two different
292 $B$"$k$?$aMQ0U$5$l$F$$$k!%(B 275 % clones of a repository may identify different changesets.
276 % Why provide the number at all, then? For local
277 % convenience.
278 \item[\texttt{changeset}] $BHV9f!$$=$l$KB3$/%3%m%s$*$h$S(B16$B?JJ8;zNs!%$3$l$O(B
279 $B%A%'%s%8%;%C%H$N(B\emph{$B<1JL;R(B}$B$G$"$k!%(B16$B?JJ8;zNs$O8GM-$N<1JL(B
280 $B;R$G!$F10l$N<1JL;R$O>o$KF1$8%A%'%s%8%;%C%H$r;X$9!%HV9f$OC;$/(B
281 $BF~NO$b(B16$B?JJ8;zNs$h$jMF0W$G$"$k$,!$%A%'%s%8%;%C%H$K8GM-$G$O$J(B
282 $B$$!%F1$8HV9f$G$b%j%]%8%H%j$NJL$N%/%m!<%s$G$O!$0c$&%A%'%s%8%;%C(B
283 $B%H$r;X$92DG=@-$,$"$k!%HV9f$OC1$K%m!<%+%k$JMxJX$N$?$a$KDs6!$5(B
284 $B$l$F$$$k!%(B
293 %\item[\texttt{user}] The identity of the person who created the 285 %\item[\texttt{user}] The identity of the person who created the
294 % changeset. This is a free-form field, but it most often contains a 286 % changeset. This is a free-form field, but it most often contains a
295 % person's name and email address. 287 % person's name and email address.
296 \item[\texttt{user}] $B%A%'%s%8%;%C%H:n@.<T!%$3$N%U%#!<%k%I$N=q<0$O<+M3$@(B 288 \item[\texttt{user}] $B%A%'%s%8%;%C%H:n@.<T!%$3$N%U%#!<%k%I$N=q<0$O<+M3$@(B
297 $B$,!$KX$s$I$N>l9g;aL>$H(Bemail$B%"%I%l%9$G$"$k!%(B 289 $B$,!$$[$H$s$I$N>l9g;aL>$H(Bemail$B%"%I%l%9$G$"$k!%(B
298 %\item[\texttt{date}] The date and time on which the changeset was 290 %\item[\texttt{date}] The date and time on which the changeset was
299 % created, and the timezone in which it was created. (The date and 291 % created, and the timezone in which it was created. (The date and
300 % time are local to that timezone; they display what time and date it 292 % time are local to that timezone; they display what time and date it
301 % was for the person who created the changeset.) 293 % was for the person who created the changeset.)
302 \item[\texttt{date}] $B%A%'%s%8%;%C%H$,:n@.$5$l$?F|IU$H;~9o$*$h$S%?%$%`%>!<(B 294 \item[\texttt{date}] $B%A%'%s%8%;%C%H$,:n@.$5$l$?F|IU$H;~9o$*$h$S%?%$%`%>!<(B
304 $B%+%k$G$"$k!%!K(B 296 $B%+%k$G$"$k!%!K(B
305 %\item[\texttt{summary}] The first line of the text message that the 297 %\item[\texttt{summary}] The first line of the text message that the
306 % creator of the changeset entered to describe the changeset. 298 % creator of the changeset entered to describe the changeset.
307 \item[\texttt{summary}] $B%F%-%9%H%a%C%;!<%8$N:G=i$N9T$O%A%'%s%8%;%C%H$N@b(B 299 \item[\texttt{summary}] $B%F%-%9%H%a%C%;!<%8$N:G=i$N9T$O%A%'%s%8%;%C%H$N@b(B
308 $BL@$KF~NO$5$l$?%A%'%s%8%;%C%H$N:n@.<T$G$"$k!%(B 300 $BL@$KF~NO$5$l$?%A%'%s%8%;%C%H$N:n@.<T$G$"$k!%(B
301 % \item Some changesets, such as the first in the list above, have a
302 % \texttt{tag} field. A tag is another way to identify a
303 % changeset, by giving it an easy-to-remember name. (The tag
304 % named \texttt{tip} is special: it always refers to the
305 % newest change in a repository.)
306 \item $B>e$N%j%9%H$N:G=i$N%A%'%s%8%;%C%H$N$h$&$K(B\texttt{tag}$B%U%#!<%k%I$r;}(B
307 $B$D%A%'%s%8%;%C%H$b$"$k!%%?%0$O%A%'%s%8%;%C%H$r<1JL$9$k$?$a$N$b$&(B
308 $B0l$D$NJ}K!$G!$3P$($d$9$$L>A0$r<+M3$KIU$1$k$3$H$,$G$-$k!%!J%?%0(B
309 \texttt{tip}$B$OFCJL$G!$>o$K%j%]%8%H%j$N:G?7$N%A%'%s%8%;%C%H$r;X$9!%!K(B
309 \end{itemize} 310 \end{itemize}
310 %The default output printed by \hgcmd{log} is purely a summary; it is 311 %The default output printed by \hgcmd{log} is purely a summary; it is
311 %missing a lot of detail. 312 %missing a lot of detail.
312 \hgcmd{log}$B$N%G%U%)%k%H=PNO$OMWLs$K$9$.$:!$B?$/$N>\:Y>pJs$r7g$$$F$$$k!%(B 313 \hgcmd{log}$B$N%G%U%)%k%H=PNO$OMWLs$K$9$.$:!$B?$/$N>\:Y>pJs$r7g$$$F$$$k!%(B
313 314
358 ``a~\emph{specific} changeset''$B$r;2>H$9$k(B\emph{$B<1JL;R(B}$B$OHs>o$K=EMW$G$"$k!%(B 359 ``a~\emph{specific} changeset''$B$r;2>H$9$k(B\emph{$B<1JL;R(B}$B$OHs>o$K=EMW$G$"$k!%(B
359 \hgcmd{log}$B%3%^%s%I$N=PNO$K4^$^$l$k(B\texttt{changeset}$B%U%#!<%k%I$O!$$"$k%A%'(B 360 \hgcmd{log}$B%3%^%s%I$N=PNO$K4^$^$l$k(B\texttt{changeset}$B%U%#!<%k%I$O!$$"$k%A%'(B
360 $B%s%8%;%C%H$rHV9f$H(B16$B?JJ8;zNs$GI=$7$F$$$?$3$H$r;W$$=P$7$FM_$7$$!%(B 361 $B%s%8%;%C%H$rHV9f$H(B16$B?JJ8;zNs$GI=$7$F$$$?$3$H$r;W$$=P$7$FM_$7$$!%(B
361 362
362 %\begin{itemize} 363 %\begin{itemize}
363 %\item The revision number is \emph{only valid in that repository}, 364 %\item The revision number is a handy notation that \emph{only valid in
364 %\item while the hex string is the \emph{permanent, unchanging 365 % that repository}.
366 %\item The hexadecimal string is the \emph{permanent, unchanging
365 % identifier} that will always identify that exact changeset in 367 % identifier} that will always identify that exact changeset in
366 % \emph{every} copy of the repository. 368 % \emph{every} copy of the repository.
367 %\end{itemize} 369 %\end{itemize}
368 \begin{itemize} 370 \begin{itemize}
369 \item $B%j%S%8%g%sHV9f$O(B\emph{$B$=$N%j%]%8%H%j$K8B$C$FM-8z$G$"$j(B}$B!$(B 371 \item $B%j%S%8%g%sHV9f$O(B\emph{$B$=$N%j%]%8%H%j$K8B$C$FM-8z(B}$B$J4JJX5-K!$G$"$k!%(B
370 \item $B$=$l$KBP$7$F(B16$B?JJ8;zNs$O(B\emph{$B1JB3E*$+$DITJQ$N<1JL;R(B}$B$G!$%j%]%8%H(B 372 \item 16$B?JJ8;zNs$O(B\emph{$B1JB3E*$+$DITJQ$N<1JL;R(B}$B$G!$%j%]%8%H%j$N%3%T!<(B
371 $B%j$N%3%T!<(B\emph{$BA4$F(B}$B$G>o$KFCDj$N%A%'%s%8%;%C%H$r<($9!%(B 373 \emph{$BA4$F(B}$B$G>o$KFCDj$N%A%'%s%8%;%C%H$r<($9!%(B
372 \end{itemize} 374 \end{itemize}
373 375
374 %This distinction is important. If you send someone an email talking 376 %This distinction is important. If you send someone an email talking
375 %about ``revision~33'', there's a high likelihood that their 377 %about ``revision~33'', there's a high likelihood that their
376 %revision~33 will \emph{not be the same} as yours. The reason for this 378 %revision~33 will \emph{not be the same} as yours. The reason for this
377 %is that a revision number depends on the order in which changes 379 %is that a revision number depends on the order in which changes
378 %arrived in a repository, and there is no guarantee that the same 380 %arrived in a repository, and there is no guarantee that the same
379 %changes will happen in the same order in different repositories. 381 %changes will happen in the same order in different repositories.
380 %Three changes $a,b,c$ can easily appear in one repository as $0,1,2$, 382 %Three changes $a,b,c$ can easily appear in one repository as $0,1,2$,
381 %while in another as $1,0,2$. 383 %while in another as $0,2,1$.
382 384
383 $B$3$N6hJL$O=EMW$G$"$k!%C/$+$K(B``revision~33''$B$H8@$C$?;~!$$=$N%j%S%8%g%s(B33$B$,(B 385 $B$3$N6hJL$O=EMW$G$"$k!%C/$+$K(B``revision~33''$B$H8@$C$?;~!$$=$N%j%S%8%g%s(B33$B$,(B
384 $B<+J,$N%j%]%8%H%j$N%j%]%8%H%j$N$b$N$H$O(B\emph{$B0c$&$b$N$G$"$k(B}$B2DG=@-$O9b$$!%(B 386 $B<+J,$N%j%]%8%H%j$N%j%]%8%H%j$N$b$N$H$O(B\emph{$B0c$&$b$N$G$"$k(B}$B2DG=@-$O9b$$!%(B
385 $B$=$NM}M3$O!$%j%S%8%g%sHV9f$O%j%]%8%H%j$KJQ99$,8=$l$?=g=x$K$h$C$F7h$^(B 387 $B$=$NM}M3$O!$%j%S%8%g%sHV9f$O%j%]%8%H%j$KJQ99$,8=$l$?=g=x$K$h$C$F7h$^(B
386 $B$j!$(BMercurial$B$G$OJL$N%j%]%8%H%j$GF1$8JQ99$,F1$8=g=x$G5/$3$kJ]>Z$O$J$$$?$a(B 388 $B$j!$(BMercurial$B$G$OJL$N%j%]%8%H%j$GF1$8JQ99$,F1$8=g=x$G5/$3$kJ]>Z$O$J$$$?$a(B
387 $B$G$"$k!%(B 3$B$D$NJQ99(B$a,b,c$$B$O!$$"$k%j%]%8%H%j$G(B$0,1,2$$B$N=g$G5/$3$j!$JL$N%j(B 389 $B$G$"$k!%(B 3$B$D$NJQ99(B$a,b,c$$B$O!$$"$k%j%]%8%H%j$G(B$0,1,2$$B$N=g$G5/$3$j!$JL$N%j(B
388 $B%]%8%H%j$G$O(B$1,0,2$$B$N=g=x$G5/$3$jF@$k!%(B 390 $B%]%8%H%j$G$O(B$0,2,1$$B$N=g=x$G5/$3$jF@$k!%(B
389 391
390 %Mercurial uses revision numbers purely as a convenient shorthand. If 392 %Mercurial uses revision numbers purely as a convenient shorthand. If
391 %you need to discuss a changeset with someone, or make a record of a 393 %you need to discuss a changeset with someone, or make a record of a
392 %changeset for some other reason (for example, in a bug report), use 394 %changeset for some other reason (for example, in a bug report), use
393 %the hexadecimal identifier. 395 %the hexadecimal identifier.
399 %\subsection{Viewing specific revisions} 401 %\subsection{Viewing specific revisions}
400 \subsection{$BFCDj$N%j%S%8%g%s$r8+$k(B} 402 \subsection{$BFCDj$N%j%S%8%g%s$r8+$k(B}
401 403
402 %To narrow the output of \hgcmd{log} down to a single revision, use the 404 %To narrow the output of \hgcmd{log} down to a single revision, use the
403 %\hgopt{log}{-r} (or \hgopt{log}{--rev}) option. You can use either a 405 %\hgopt{log}{-r} (or \hgopt{log}{--rev}) option. You can use either a
404 %revision number or a long-form changeset identifier, and you can 406 %revision number or a hexadecimal changeset identifier, and you can
405 %provide as many revisions as you want. \interaction{tour.log-r} 407 %provide as many revisions as you want. \interaction{tour.log-r}
406 408
407 \hgcmd{log}$B$N=PNO$r$"$k(B1$B$D$N%j%S%8%g%s$K@)8B$9$k$?$a$K$O!$(B 409 \hgcmd{log}$B$N=PNO$r$"$k(B1$B$D$N%j%S%8%g%s$K@)8B$9$k$?$a$K$O!$(B
408 \hgopt{log}{-r}$B!J$^$?$O(B \hgopt{log}{--rev}$B!K%*%W%7%g%s$rMQ$$$k!%%j%S%8%g(B 410 \hgopt{log}{-r}$B!J$^$?$O(B \hgopt{log}{--rev}$B!K%*%W%7%g%s$rMQ$$$k!%%j%S%8%g(B
409 $B%sHV9f$bD97A<0$N%A%'%s%8%;%C%H<1JL;R$bMxMQ2DG=$G$"$j!$;XDj$G$-$k%j%S%8%g(B 411 $B%sHV9f$b(B16$B?JJ8;zNs$N%A%'%s%8%;%C%H<1JL;R$bMxMQ2DG=$G$"$j!$;XDj$G$-$k%j%S(B
410 $B%s$N?t$K@)8B$O$J$$!%(B 412 $B%8%g%s$N?t$K@)8B$O$J$$!%(B
411 \interaction{tour.log-r} 413 \interaction{tour.log-r}
412 414
413 %If you want to see the history of several revisions without having to 415 %If you want to see the history of several revisions without having to
414 %list each one, you can use \emph{range notation}; this lets you 416 %list each one, you can use \emph{range notation}; this lets you
415 %express the idea ``I want all revisions between $a$ and $b$, 417 %express the idea ``I want all revisions between $a$ and $b$,
453 $B@bL@$HJQ99$NFbMF$NN>J}$r8+$?$$>l9g$O(B\hgopt{log}{-p}$B!J$^$?$O(B 455 $B@bL@$HJQ99$NFbMF$NN>J}$r8+$?$$>l9g$O(B\hgopt{log}{-p}$B!J$^$?$O(B
454 \hgopt{log}{--patch}$B!K%*%W%7%g%s$rDI2C$9$k!%$3$N%*%W%7%g%s$OJQ99$NFbMF$r(B 456 \hgopt{log}{--patch}$B!K%*%W%7%g%s$rDI2C$9$k!%$3$N%*%W%7%g%s$OJQ99$NFbMF$r(B
455 \emph{unified diff}$B7A<0$GI=<($9$k!%!J(Bunified diff$B7A<0$r8+$?$3$H$,$J$1$l(B 457 \emph{unified diff}$B7A<0$GI=<($9$k!%!J(Bunified diff$B7A<0$r8+$?$3$H$,$J$1$l(B
456 $B$P35N,$r(B\ref{sec:mq:patch}$B@a$G8+$k$3$H$,$G$-$k!%!K(B 458 $B$P35N,$r(B\ref{sec:mq:patch}$B@a$G8+$k$3$H$,$G$-$k!%!K(B
457 \interaction{tour.log-vp} 459 \interaction{tour.log-vp}
460
461 %The \hgopt{log}{-p} option is tremendously useful, so it's well worth
462 %remembering.
463
464 \hgopt{log}{-p}$B%*%W%7%g%s$O6C0[E*$KJXMx$J$N$G3P$($F$*$/$HNI$$!%(B
458 465
459 %\section{All about command options} 466 %\section{All about command options}
460 \section{$B%3%^%s%I%*%W%7%g%s$N$9$Y$F(B} 467 \section{$B%3%^%s%I%*%W%7%g%s$N$9$Y$F(B}
461 468
462 %Let's take a brief break from exploring Mercurial commands to discuss 469 %Let's take a brief break from exploring Mercurial commands to discuss
496 % revision number accepts both \hgopt{log}{-r} and \hgopt{log}{--rev} 503 % revision number accepts both \hgopt{log}{-r} and \hgopt{log}{--rev}
497 % arguments. 504 % arguments.
498 \item $B%*%W%7%g%s$NL?L>$H;HMQK!$O%3%^%s%I4V$G0l4S$7$F$$$k!%Nc$r5s$2$k$H!$(B 505 \item $B%*%W%7%g%s$NL?L>$H;HMQK!$O%3%^%s%I4V$G0l4S$7$F$$$k!%Nc$r5s$2$k$H!$(B
499 $B%A%'%s%8%;%C%H(BID$B$^$?$O%j%S%8%g%sHV9f$r;XDj$5$;$k%3%^%s%I$NA4$F$G(B 506 $B%A%'%s%8%;%C%H(BID$B$^$?$O%j%S%8%g%sHV9f$r;XDj$5$;$k%3%^%s%I$NA4$F$G(B
500 \hgopt{log}{-r}$B$H(B\hgopt{log}{--rev}$B$NN>J}$r<u$1IU$1$k!%(B 507 \hgopt{log}{-r}$B$H(B\hgopt{log}{--rev}$B$NN>J}$r<u$1IU$1$k!%(B
508 % \item If you are using short options, you can save typing by running
509 % them together. For example, the command \hgopt{log}{-v -p -r 2}
510 % can be written as \hgopt{log}{-vpr2}
511 \item $BC;7A<0$N%*%W%7%g%s$r;H$C$F$$$k;~$O$"!$J#?t$N%*%W%7%g%s$rAH$_9g$o$;(B
512 $B$FF~NO$N<j4V$r>J$/$3$H$,$G$-$k!%Nc$($P(B\hgopt{log}{-v -p -r 2}$B$O(B
513 \hgopt{log}{-vpr2}$B$H=q$/$3$H$,$G$-$k!%(B
501 \end{itemize} 514 \end{itemize}
502 %In the examples throughout this book, I use short options instead of 515 %In the examples throughout this book, I use short options instead of
503 %long. This just reflects my own preference, so don't read anything 516 %long. This just reflects my own preference, so don't read anything
504 %significant into it. 517 %significant into it.
505 $B$3$NK\$NNc$NA4$F$GC;7A<0$N%*%W%7%g%s$rMQ$$$k!%$3$l$OC1$KI.<T$N9%$_$N$?$a(B 518 $B$3$NK\$NNc$NA4$F$GC;7A<0$N%*%W%7%g%s$rMQ$$$k!%$3$l$OC1$KI.<T$N9%$_$N$?$a(B
510 %when passed \hggopt{-q} (or \hggopt{--quiet}). 523 %when passed \hggopt{-q} (or \hggopt{--quiet}).
511 $BI=<(=PNO$r9T$&$[$H$s$I$N%3%^%s%I$G(B\hggopt{-v}$B!J$^$?$O(B\hggopt{--verbose}$B!K(B 524 $BI=<(=PNO$r9T$&$[$H$s$I$N%3%^%s%I$G(B\hggopt{-v}$B!J$^$?$O(B\hggopt{--verbose}$B!K(B
512 $B%*%W%7%g%s$rIU$1$k$H$h$j>\:Y$J=PNO$r9T$$!$(B\hggopt{-q}$B!J$^$?$O(B 525 $B%*%W%7%g%s$rIU$1$k$H$h$j>\:Y$J=PNO$r9T$$!$(B\hggopt{-q}$B!J$^$?$O(B
513 \hggopt{--quiet}$B!K%*%W%7%g%s$rIU$1$k$H$h$j4J7i$J=PNO$H$J$k!%(B 526 \hggopt{--quiet}$B!K%*%W%7%g%s$rIU$1$k$H$h$j4J7i$J=PNO$H$J$k!%(B
514 527
528 %\begin{note}
529 %Option naming consistency
530 %
531 %Almost always, Mercurial commands use consistent option names to refer
532 %to the same concepts. For instance, if a command deals with changesets,
533 %you'll always identify them with \hgopt{log}{--rev} or \hgopt{log}{-r}
534
535 %This consistent use of option names makes it easier to remember what
536 %options a particular command takes.
537 %\end{note}
538
539 \begin{note}
540 $B%*%W%7%g%sL>$N0l4S@-(B
541
542 Mercurial$B%3%^%s%I$G$O!$F1$8BP>]$r07$&:]!$$[$H$s$I>o$KF1$8%*%W%7%g%sL>$r;H(B
543 $B$&$h$&$K$J$C$F$$$k!%Nc$r5s$2$k$H!$%A%'%s%8%;%C%H$r07$&%3%^%s%I$N>l9g$O>o(B
544 $B$K(B\hgopt{log}{--rev}$B$d(B\hgopt{log}{-r}$B$G%A%'%s%8%;%C%H$N;XDj$,$G$-$k!%$3$N(B
545 $B0l4S@-$K$h$j!$AH$^$s$I$N%*%W%7%g%s$,3P$($d$9$/$J$C$F$$$k!%(B
546 \end{note}
547
515 %\section{Making and reviewing changes} 548 %\section{Making and reviewing changes}
516 \section{$BJQ99$N;EJ}!$JQ99$N%l%S%e!<(B} 549 \section{$BJQ99$N;EJ}!$JQ99$N%l%S%e!<(B}
517 550
518 %Now that we have a grasp of viewing history in Mercurial, let's take a 551 %Now that we have a grasp of viewing history in Mercurial, let's take a
519 %look at making some changes and examining them. 552 %look at making some changes and examining them.
525 %its own. We use the \hgcmd{clone} command, but we don't need to 558 %its own. We use the \hgcmd{clone} command, but we don't need to
526 %clone a copy of the remote repository. Since we already have a copy 559 %clone a copy of the remote repository. Since we already have a copy
527 %of it locally, we can just clone that instead. This is much faster 560 %of it locally, we can just clone that instead. This is much faster
528 %than cloning over the network, and cloning a local repository uses 561 %than cloning over the network, and cloning a local repository uses
529 %less disk space in most cases, too. 562 %less disk space in most cases, too.
563 %\begin{footnote}
564 %The saving of space arises when source and destination repositories are
565 %on the same filesystem, in which case Mercurial will use hardlinks to do
566 %copy-on-write sharing of its internal metadata. If that explanation
567 %meant nothing to you, don't worry: everything happens transparently and
568 %automatically, and you don't need to understand it.
569 %\end{footnote}
530 %\interaction{tour.reclone} 570 %\interaction{tour.reclone}
531 %As an aside, it's often good practice to keep a ``pristine'' copy of a 571 %As an aside, it's often good practice to keep a ``pristine'' copy of a
532 %remote repository around, which you can then make temporary clones of 572 %remote repository around, which you can then make temporary clones of
533 %to create sandboxes for each task you want to work on. This lets you 573 %to create sandboxes for each task you want to work on. This lets you
534 %work on multiple tasks in parallel, each isolated from the others 574 %work on multiple tasks in parallel, each isolated from the others
539 $B$^$::G=i$K$3$N<B83$rK\Mh$N%j%]%8%H%j$+$i3VN%$9$k$?$a$K(B\hgcmd{clone}$B$r9T(B 579 $B$^$::G=i$K$3$N<B83$rK\Mh$N%j%]%8%H%j$+$i3VN%$9$k$?$a$K(B\hgcmd{clone}$B$r9T(B
540 $B$&!%$9$G$K%m!<%+%k$J%j%]%8%H%j$r;}$C$F$$$k$N$G!$$3$l$r%/%m!<%s$9$k$@$1$G(B 580 $B$&!%$9$G$K%m!<%+%k$J%j%]%8%H%j$r;}$C$F$$$k$N$G!$$3$l$r%/%m!<%s$9$k$@$1$G(B
541 $B$h$/!$%j%b!<%H$N%j%]%8%H%j$r%3%T!<$9$kI,MW$O$J$$!%%m!<%+%k$J%/%m!<%s$O%M%C(B 581 $B$h$/!$%j%b!<%H$N%j%]%8%H%j$r%3%T!<$9$kI,MW$O$J$$!%%m!<%+%k$J%/%m!<%s$O%M%C(B
542 $B%H%o!<%/1[$7$K9T$&%/%m!<%s$h$j$b$:$C$HB.$/!$B?$/$N>l9g;HMQ$9$k%G%#%9%/MF(B 582 $B%H%o!<%/1[$7$K9T$&%/%m!<%s$h$j$b$:$C$HB.$/!$B?$/$N>l9g;HMQ$9$k%G%#%9%/MF(B
543 $BNL$b>/$J$$!%(B 583 $BNL$b>/$J$$!%(B
584 \begin{footnote}
585 $BF10l%U%!%$%k%7%9%F%`>e$G%j%]%8%H%j$N%/%m!<%s$r9T$&>l9g!$(B Mercurial$B$O%O!<(B
586 $B%I%j%s%/$r;H$$!$FbIt%a%?%G!<%?$r%3%T!<%*%s%i%$%H$G6&M-$7!$%G%#%9%/;HMQNL(B
587 $B$N@aLs$r9T$&!%$3$N@bL@$,$h$/$o$+$i$J$/$F$b?4G[$9$kI,MW$O$J$$!%$3$NF0:n$O(B
588 $B$9$Y$FF)2aE*$+$D<+F0E*$K9T$o$l$k$?$a!$5$$K$9$kI,MW$O$J$$!%(B
589 \end{footnote}
544 \interaction{tour.reclone} 590 \interaction{tour.reclone}
545 $B$^$?!$2?$+:n6H$r$7$?$$;~$K%5%s%I%\%C%/%9$H$9$k$?$a$K0l;~E*$J%/%m!<%s$r:n(B 591 $B$^$?!$2?$+:n6H$r$7$?$$;~$K%5%s%I%\%C%/%9$H$9$k$?$a$K0l;~E*$J%/%m!<%s$r:n(B
546 $B@.$7!$%j%b!<%H%j%]%8%H%j$N%3%T!<$r(B``$B@67i(B''$B$KJ]$D$3$H$O$7$P$7$PLr$KN)$D!%(B 592 $B@.$7!$%j%b!<%H%j%]%8%H%j$N%3%T!<$r(B``$B@67i(B''$B$KJ]$D$3$H$O$7$P$7$PLr$KN)$D!%(B
547 $B$3$l$K$h$jJ#?t$N:n6H$rJB9T$7$F9T$&$3$H$,$G$-!$$+$D!$:n6H$,40N;$7!$:F$SE}(B 593 $B$3$l$K$h$jJ#?t$N:n6H$rJB9T$7$F9T$&$3$H$,$G$-!$$+$D!$:n6H$,40N;$7!$:F$SE}(B
548 $B9g$9$k$^$GB>$N:n6H$+$i3VN%$5$l$?$^$^$K$7$F$*$/$3$H$,$G$-$k!%%j%]%8%H%j$N(B 594 $B9g$9$k$^$GB>$N:n6H$+$i3VN%$5$l$?$^$^$K$7$F$*$/$3$H$,$G$-$k!%%j%]%8%H%j$N(B
549 $B%m!<%+%k%/%m!<%s$O$H$F$b<j7Z$G!$%/%m!<%s$HGQ4~$K$[$H$s$I%*!<%P%X%C%I$,$J(B 595 $B%m!<%+%k%/%m!<%s$O$H$F$b<j7Z$G!$%/%m!<%s$HGQ4~$K$[$H$s$I%*!<%P%X%C%I$,$J(B
550 $B$$!%(B 596 $B$$!%(B
551 597
552 %In our \dirname{my-hello} repository, we have a file 598 %In our \dirname{my-hello} repository, we have a file
553 %\filename{hello.c} that contains the classic ``hello, world'' program. 599 %\filename{hello.c} that contains the classic ``hello, world'' program.
554 %Let's use the ancient and venerable \command{sed} command to edit this 600 %\interaction{tour.cat1}
555 %file so that it prints a second line of output. (I'm only using
556 %\command{sed} to do this because it's easy to write a scripted example
557 %this way. Since you're not under the same constraint, you probably
558 %won't want to use \command{sed}; simply use your preferred text editor to
559 %do the same thing.)
560 %\interaction{tour.sed}
561
562 \dirname{my-hello}$B%j%]%8%H%jFb$K$O%/%i%7%C%/$J(B``hello, world''$B%W%m%0%i%`(B 601 \dirname{my-hello}$B%j%]%8%H%jFb$K$O%/%i%7%C%/$J(B``hello, world''$B%W%m%0%i%`(B
563 $B$G$"$k(B\filename{hello.c}$B$,$"$k!%8E$/$5$/?987$J(B\command{sed}$B$rMQ$$$F(B2$B9TL\(B 602 $B$G$"$k(B\filename{hello.c}$B$,$"$k!%(B
564 $B$N=PNO$r9T$&$h$&$KJQ99$9$k!%!J(B\command{sed}$B$r;H$&$N$O%9%/%j%W%H$K$h$kNc$r(B 603 \interaction{tour.cat1}
565 $B:n$k$N$,4JC1$@$+$i$K2a$.$J$$!%FI<T$^$G(B\command{sed}$B$r;H$&I,MW$O$J$/!$9%$-(B 604
566 $B$J%F%-%9%H%(%G%#%?$GJT=8$7$F$h$$!%!K(B 605 %Let's edit this file so that it prints a second line of output.
567 \interaction{tour.sed} 606 %\interaction{tour.cat2}
607 $B$3$N%U%!%$%k$r(B2$B9TL\$,=PNO$5$l$k$h$&$KJT=8$9$k!%(B
608 \interaction{tour.cat2}
568 609
569 %Mercurial's \hgcmd{status} command will tell us what Mercurial knows 610 %Mercurial's \hgcmd{status} command will tell us what Mercurial knows
570 %about the files in the repository. 611 %about the files in the repository.
571 %\interaction{tour.status} 612 %\interaction{tour.status}
572 %The \hgcmd{status} command prints no output for some files, but a line 613 %The \hgcmd{status} command prints no output for some files, but a line
573 %starting with ``\texttt{M}'' for \filename{hello.c}. Unless you tell 614 %starting with ``\texttt{M}'' for \filename{hello.c}. Unless you tell
574 %it to, \hgcmd{status} will not print any output for files that have 615 %it to, \hgcmd{status} will not print any output for files that have
575 %not been modified. 616 %not been modified.
576
577 $B%j%]%8%H%jFb$N%U%!%$%k$KBP$7$F(BMercurial$B$,GD0.$7$F$$$kFbMF$r(B 617 $B%j%]%8%H%jFb$N%U%!%$%k$KBP$7$F(BMercurial$B$,GD0.$7$F$$$kFbMF$r(B
578 \hgcmd{status}$B%3%^%s%I$G8+$k$3$H$,$G$-$k!%(B 618 \hgcmd{status}$B%3%^%s%I$G8+$k$3$H$,$G$-$k!%(B
579 \interaction{tour.status} 619 \interaction{tour.status}
580 \hgcmd{status}$B%3%^%s%I$O$$$/$D$+$N%U%!%$%k$KBP$7$F$O=PNO$r9T$o$J$$$,!$(B 620 \hgcmd{status}$B%3%^%s%I$O$$$/$D$+$N%U%!%$%k$KBP$7$F$O=PNO$r9T$o$J$$$,!$(B
581 \filename{hello.c}$B$KBP$7$F(B``\texttt{M}''$B$rI=<($9$k!%FC$K;X<($r$7$J$$>l(B 621 \filename{hello.c}$B$KBP$7$F(B``\texttt{M}''$B$rI=<($9$k!%FC$K;X<($r$7$J$$>l(B
591 ``\texttt{M}''$B$N0UL#$O!$(B\filename{hello.c}$B$KBP$7$F9T$o$l$?JQ99$r(B 631 ``\texttt{M}''$B$N0UL#$O!$(B\filename{hello.c}$B$KBP$7$F9T$o$l$?JQ99$r(B
592 Mercurial$B$,GD0.$7$?$H$$$&$3$H$G$"$k!%%U%!%$%k$NJQ99A0$K(BMercurial$B$K$3$l$+(B 632 Mercurial$B$,GD0.$7$?$H$$$&$3$H$G$"$k!%%U%!%$%k$NJQ99A0$K(BMercurial$B$K$3$l$+(B
593 $B$iJQ99$9$k%U%!%$%k$rEPO?$9$kI,MW$O$J$$$7!$JQ998e$K9T$&I,MW$b$J$$!%JQ99$5(B 633 $B$iJQ99$9$k%U%!%$%k$rEPO?$9$kI,MW$O$J$$$7!$JQ998e$K9T$&I,MW$b$J$$!%JQ99$5(B
594 $B$l$?%U%!%$%k$NH/8+$O<+F0E*$K9T$o$l$k!%(B 634 $B$l$?%U%!%$%k$NH/8+$O<+F0E*$K9T$o$l$k!%(B
595 635
596 %It's a little bit helpful to know that we've modified 636 %It's a somewhat helpful to know that we've modified
597 %\filename{hello.c}, but we might prefer to know exactly \emph{what} 637 %\filename{hello.c}, but we might prefer to know exactly \emph{what}
598 %changes we've made to it. To do this, we use the \hgcmd{diff} 638 %changes we've made to it. To do this, we use the \hgcmd{diff}
599 %command. 639 %command.
600 %\interaction{tour.diff} 640 %\interaction{tour.diff}
601 641
602 \filename{hello.c}$B$rJT=8$7$?$3$H$,J,$+$k$N$OB?>/Lr$KN)$D$,!$CN$j$?$$$N$O(B 642 \filename{hello.c}$B$rJT=8$7$?$3$H$,J,$+$k$N$OB?>/Lr$KN)$D$,!$CN$j$?$$$N$O(B
603 $B$`$7$m(B\emph{$B2?$r(B}$BJQ99$7$?$N$+$G$"$k!%(B\hgcmd{diff}$B%3%^%s%I$r;H$($P$3$l$rCN(B 643 $B$`$7$m(B\emph{$B2?$r(B}$BJQ99$7$?$N$+$G$"$k!%(B\hgcmd{diff}$B%3%^%s%I$r;H$($P$3$l$rCN(B
604 $B$k$3$H$,$G$-$k!%(B \interaction{tour.diff} 644 $B$k$3$H$,$G$-$k!%(B \interaction{tour.diff}
645
646 %\begin{note}
647 %Understanding patches
648 %
649 %Remember to take a look at section~\ref{sec:mq:patch} if you don't know
650 %how to read output above.
651 %\end{note}
652
653 \begin{note}
654 $B%Q%C%A$K$D$$$F(B
655
656 $B>e$N=PNO$NFI$_J}$,J,$+$i$J$$>l9g$O!$(B\ref{sec:mq:patch}$B@a$r;2>H$5$l$?$$!%(B
657 \end{note}
605 658
606 %\section{Recording changes in a new changeset} 659 %\section{Recording changes in a new changeset}
607 \section{$B?7$?$J%A%'%s%8%;%C%H$XJQ99$r5-O?$9$k(B} 660 \section{$B?7$?$J%A%'%s%8%;%C%H$XJQ99$r5-O?$9$k(B}
608 661
609 %We can modify files, build and test our changes, and use 662 %We can modify files, build and test our changes, and use
688 741
689 %To set a user name, use your favourite editor to create a file called 742 %To set a user name, use your favourite editor to create a file called
690 %\sfilename{.hgrc} in your home directory. Mercurial will use this 743 %\sfilename{.hgrc} in your home directory. Mercurial will use this
691 %file to look up your personalised configuration settings. The initial 744 %file to look up your personalised configuration settings. The initial
692 %contents of your \sfilename{.hgrc} should look like this. 745 %contents of your \sfilename{.hgrc} should look like this.
746 %\begin{footnote}
747 %Figure out what the appropriate directory is on Windows.
748 %\end{footnote}
693 %\begin{codesample2} 749 %\begin{codesample2}
694 % # This is a Mercurial configuration file. 750 % # This is a Mercurial configuration file.
695 % [ui] 751 % [ui]
696 % username = Firstname Lastname <email.address@domain.net> 752 % username = Firstname Lastname <email.address@domain.net>
697 %\end{codesample2} 753 %\end{codesample2}
704 760
705 $B%f!<%6L>$r@_Dj$9$k$K$O9%$_$N%(%G%#%?$G%[!<%`%G%#%l%/%H%j$K(B 761 $B%f!<%6L>$r@_Dj$9$k$K$O9%$_$N%(%G%#%?$G%[!<%`%G%#%l%/%H%j$K(B
706 \sfilename{.hgrc}$B$H$$$&%U%!%$%k$r:n@.$9$k!%(B Mercurial$B$O$3$N%U%!%$%k$+$i8D(B 762 \sfilename{.hgrc}$B$H$$$&%U%!%$%k$r:n@.$9$k!%(B Mercurial$B$O$3$N%U%!%$%k$+$i8D(B
707 $B?M@_Dj$r<hF@$7!$;HMQ$9$k!%(B\sfilename{.hgrc}$B%U%!%$%k$N:G=i$NFbMF$O0J2<$N$h(B 763 $B?M@_Dj$r<hF@$7!$;HMQ$9$k!%(B\sfilename{.hgrc}$B%U%!%$%k$N:G=i$NFbMF$O0J2<$N$h(B
708 $B$&$J=q<0$K$9$k!%(B 764 $B$&$J=q<0$K$9$k!%(B
765 \begin{footnote}
766 Windows$B$G$NE,@Z$J%G%#%l%/%H%j$r<($9$3$H!%(B
767 \end{footnote}
709 \begin{codesample2} 768 \begin{codesample2}
710 # This is a Mercurial configuration file. 769 # This is a Mercurial configuration file.
711 [ui] 770 [ui]
712 username = Firstname Lastname <email.address@domain.net> 771 username = Firstname Lastname <email.address@domain.net>
713 \end{codesample2} 772 \end{codesample2}
721 %\subsubsection{Choosing a user name} 780 %\subsubsection{Choosing a user name}
722 \subsubsection{$B%f!<%6L>$rA*$V(B} 781 \subsubsection{$B%f!<%6L>$rA*$V(B}
723 782
724 %You can use any text you like as the value of the \texttt{username} 783 %You can use any text you like as the value of the \texttt{username}
725 %config item, since this information is for reading by other people, 784 %config item, since this information is for reading by other people,
726 %but for interpreting by Mercurial. The convention that most people 785 %but will not be interpreted by Mercurial. The convention that most
727 %follow is to use their name and email address, as in the example 786 %people follow is to use their name and email address, as in the example
728 %above. 787 %above.
729 788
730 \texttt{username}$B$N@_Dj$K;HMQ$9$kJ8;zNs$O!$$3$l$,(BMercurial$B$K$h$C$F=hM}$5(B 789 \texttt{username}$B$N@_Dj$K;HMQ$9$kJ8;zNs$O!$B>$N%f!<%6$,FI$`>pJs$G$"$k$K2a(B
731 $B$l$k$H$$$&E@$r=|$1$P!$C1$KB>$N%f!<%6$,FI$`$H$$$&$@$1$N>pJs$G$"$k$3$H$+(B 790 $B$.$:!$(BMercurial$B$K$h$C$F=hM}$5$l$k$b$N$G$O$J$$$?$a!$$I$N$h$&$JJ8;zNs$G$b9=(B
732 $B$i!$$I$N$h$&$JJ8;zNs$G$b9=$o$J$$!%B?$/$N%f!<%6$,=>$&=,47$O!$>e$NNc$N$h$&(B 791 $B$o$J$$!%B?$/$N%f!<%6$,=>$&=,47$O!$>e$NNc$N$h$&$KL>A0$H(Bemail$B%"%I%l%9$r;H$&(B
733 $B$KL>A0$H(Bemail$B%"%I%l%9$r;H$&$b$N$G$"$k!%(B 792 $B$b$N$G$"$k!%(B
734 793
735 \begin{note} 794 \begin{note}
736 % Mercurial's built-in web server obfuscates email addresses, to make 795 % Mercurial's built-in web server obfuscates email addresses, to make
737 % it more difficult for the email harvesting tools that spammers use. 796 % it more difficult for the email harvesting tools that spammers use.
738 % This reduces the likelihood that you'll start receiving more junk 797 % This reduces the likelihood that you'll start receiving more junk
758 $B$3$l$O2?$r$J$<JQ99$7$?$N$+FI$_<j$KEA$($k$b$N$G!$%3%_%C%H40N;8e$K(B 817 $B$3$l$O2?$r$J$<JQ99$7$?$N$+FI$_<j$KEA$($k$b$N$G!$%3%_%C%H40N;8e$K(B
759 \hgcmd{log}$B$GI=<($9$k$3$H$,$G$-$k!%(B 818 \hgcmd{log}$B$GI=<($9$k$3$H$,$G$-$k!%(B
760 \interaction{tour.commit} 819 \interaction{tour.commit}
761 820
762 %The editor that the \hgcmd{commit} command drops us into will contain 821 %The editor that the \hgcmd{commit} command drops us into will contain
763 %an empty line, followed by a number of lines starting with 822 %an empty line or two, followed by a number of lines starting with
764 %``\texttt{HG:}''. 823 %``\texttt{HG:}''.
765 %\begin{codesample2} 824 %%\begin{codesample2}
766 % \emph{empty line} 825 %This is where I type my commit comment.
767 % HG: changed hello.c 826 %
827 %HG: Enter commit message. Lines beginning with 'HG:' are removed.
828 %HG: --
829 %HG: user: Bryan O'Sullivan <bos@serpentine.com>
830 %HG: branch 'default'
831 %HG: changed hello.c</programlisting>
768 %\end{codesample2} 832 %\end{codesample2}
769 %Mercurial ignores the lines that start with ``\texttt{HG:}''; it uses 833 %Mercurial ignores the lines that start with ``\texttt{HG:}''; it uses
770 %them only to tell us which files it's recording changes to. Modifying 834 %them only to tell us which files it's recording changes to. Modifying
771 %or deleting these lines has no effect. 835 %or deleting these lines has no effect.
772 836
773 \hgcmd{commit}$B%3%^%s%I$,5/F0$9$k%(%G%#%?$O!$6u9T$H(B``\texttt{HG:}''$B$G;O$^(B 837 \hgcmd{commit}$B%3%^%s%I$,5/F0$9$k%(%G%#%?$O!$6u9T$H(B``\texttt{HG:}''$B$G;O$^(B
774 $B$k?t9T$r$9$G$K4^$s$G$$$k!%(B 838 $B$k?t9T$r$9$G$K4^$s$G$$$k!%(B
775 \begin{codesample2} 839 \begin{codesample2}
776 \emph{empty line} 840 This is where I type my commit comment.
777 HG: changed hello.c 841
842 HG: Enter commit message. Lines beginning with 'HG:' are removed.
843 HG: --
844 HG: user: Bryan O'Sullivan <bos@serpentine.com>
845 HG: branch 'default'
846 HG: changed hello.c</programlisting>
778 \end{codesample2} 847 \end{codesample2}
779 Mercurial$B$O(B``\texttt{HG:}''$B$G;O$^$k9T$rL5;k$9$k!%$3$l$i$N9T$O$I$N%U%!%$%k(B 848 Mercurial$B$O(B``\texttt{HG:}''$B$G;O$^$k9T$rL5;k$9$k!%$3$l$i$N9T$O$I$N%U%!%$%k(B
780 $B$X$NJQ99$J$N$+$r%f!<%6$KEA$($k$@$1$NL\E*$GB8:_$9$k!%$3$l$i$N9T$rJQ99$7$?(B 849 $B$X$NJQ99$J$N$+$r%f!<%6$KEA$($k$@$1$NL\E*$GB8:_$9$k!%$3$l$i$N9T$rJQ99$7$?(B
781 $B$j>C5n$7$?$j$7$F$b2?$N1F6A$bM?$($J$$!%(B 850 $B$j>C5n$7$?$j$7$F$b2?$N1F6A$bM?$($J$$!%(B
782 851
846 %Once we've finished the commit, we can use the \hgcmd{tip} command to 915 %Once we've finished the commit, we can use the \hgcmd{tip} command to
847 %display the changeset we just created. This command produces output 916 %display the changeset we just created. This command produces output
848 %that is identical to \hgcmd{log}, but it only displays the newest 917 %that is identical to \hgcmd{log}, but it only displays the newest
849 %revision in the repository. 918 %revision in the repository.
850 %\interaction{tour.tip} 919 %\interaction{tour.tip}
851 %We refer to the newest revision in the repository as the tip revision, 920 %We refer to the newest revision in the repository as the \emph{tip revision},
852 %or simply the tip. 921 %or simply the \emph{tip}.
853 922
854 $B%3%_%C%H$N40N;8e!$(B\hgcmd{tip}$B%3%^%s%I$G:#:n@.$7$?%A%'%s%8%;%C%H$rCN$k$3$H(B 923 $B%3%_%C%H$N40N;8e!$(B\hgcmd{tip}$B%3%^%s%I$G:#:n@.$7$?%A%'%s%8%;%C%H$rCN$k$3$H(B
855 $B$,$G$-$k!%$3$N%3%^%s%I$N=PNO$O%j%]%8%H%j$N:G?7%j%S%8%g%s$N$_$rI=<($9$k$H(B 924 $B$,$G$-$k!%$3$N%3%^%s%I$N=PNO$O%j%]%8%H%j$N:G?7%j%S%8%g%s$N$_$rI=<($9$k$H(B
856 $B$$$&E@$r=|$1$P(B\hgcmd{log}$B$HA4$/F1$8$G$"$k!%(B 925 $B$$$&E@$r=|$1$P(B\hgcmd{log}$B$HA4$/F1$8$G$"$k!%(B
857 \interaction{tour.tip} 926 \interaction{tour.tip}
858 $B%j%]%8%H%j$N:G?7%j%S%8%g%s$O(Btip$B%j%S%8%g%s$^$?$OC1$K(Btip$B$H8F$P$l$k!%(B 927 $B%j%]%8%H%j$N:G?7%j%S%8%g%s$O(B\emph{tip$B%j%S%8%g%s(B}$B$^$?$OC1$K(B\emph{tip}$B$H8F(B
928 $B$P$l$k!%(B
929
930 %By the way, the \hgcmpd{tip} command accepts many of the same options as
931 %\hgcmd{log}, so \hgopt{log}{-v} above indicates ``be verbose'',
932 %\hgopt{log}{-p} specifies ``print a patch''. The use of \hgopt{log}{-p}
933 %to print patches is another example of the consistent naming we
934 %mentioned earlier.
935
936 \hgcmpd{tip}$B%3%^%s%I$G$O(B\hgcmd{log}$B%3%^%s%I$N%*%W%7%g%s$NB?$/$,;H$($k!%>e(B
937 $B5-$N(B\hgopt{log}{-v}$B$O(B``$B>iD9(B''$B$JI=<($r9T$&$7!$(B\hgopt{log}{-p}$B$O(B``$B%Q%C%A$N(B
938 $BI=<((B''$B$r9T$&!%(B\hgopt{log}{-p}$B$G%Q%C%A$,I=<($5$l$k$N$O!$A0=R$N%*%W%7%g%sL>(B
939 $B$N0l4S@-$r<($9$b$&0l$D$NNc$G$"$k!%(B
859 940
860 %\section{Sharing changes} 941 %\section{Sharing changes}
861 \section{$BJQ99$r6&M-$9$k(B} 942 \section{$BJQ99$r6&M-$9$k(B}
862 943
863 %We mentioned earlier that repositories in Mercurial are 944 %We mentioned earlier that repositories in Mercurial are
888 %pulling unknown changes into a repository is a somewhat scary 969 %pulling unknown changes into a repository is a somewhat scary
889 %prospect. Mercurial provides the \hgcmd{incoming} command to tell us 970 %prospect. Mercurial provides the \hgcmd{incoming} command to tell us
890 %what changes the \hgcmd{pull} command \emph{would} pull into the 971 %what changes the \hgcmd{pull} command \emph{would} pull into the
891 %repository, without actually pulling the changes in. 972 %repository, without actually pulling the changes in.
892 %\interaction{tour.incoming} 973 %\interaction{tour.incoming}
893 %(Of course, someone could cause more changesets to appear in the
894 %repository that we ran \hgcmd{incoming} in, before we get a chance to
895 %\hgcmd{pull} the changes, so that we could end up pulling changes that we
896 %didn't expect.)
897 974
898 \hgcmd{pull}$B%3%^%s%I$GJQ99$r(B\dirname{my-hello}$B$+$i(B\dirname{hello-pull}$B$K(B 975 \hgcmd{pull}$B%3%^%s%I$GJQ99$r(B\dirname{my-hello}$B$+$i(B\dirname{hello-pull}$B$K(B
899 $B<h$j9~$`!%L$CN$NJQ99$rLUL\E*$K%j%]%8%H%j$K(Bpull$B$9$k$3$H$O>/!962$m$7(B 976 $B<h$j9~$`!%L$CN$NJQ99$rLUL\E*$K%j%]%8%H%j$K(Bpull$B$9$k$3$H$O>/!962$m$7(B
900 $B$$!%(BMercurial$B$K$O(B\hgcmd{pull}$B%3%^%s%I$G$I$N$h$&$JJQ99$,%j%]%8%H%j$K<h$j9~(B 977 $B$$!%(BMercurial$B$K$O(B\hgcmd{pull}$B%3%^%s%I$G$I$N$h$&$JJQ99$,%j%]%8%H%j$K<h$j9~(B
901 $B$^$l$k$N$+$r<B:]$K$O(Bpull$B$9$k$3$H$J$/I=<($9$k(B\hgcmd{incoming}$B%3%^%s%I$,$"(B 978 $B$^$l$k$N$+$r<B:]$K$O(Bpull$B$9$k$3$H$J$/I=<($9$k(B\hgcmd{incoming}$B%3%^%s%I$,$"(B
902 $B$k!%(B 979 $B$k!%(B
903 \interaction{tour.incoming} 980 \interaction{tour.incoming}
904 $B!J$b$A$m$s(B\hgcmd{incoming}$B$r<B9T$7$F$+$i<B:]$K(B\hgcmd{pull}$B$9$k$^$G$N4V$K(B 981
905 $BC/$+$,?7$?$J%A%'%s%8%;%C%H$rDI2C$7!$$=$N7k2L!$M=4|$7$J$$%A%'%s%8%;%C%H$r(B 982 %Suppose you're pulling changes from a repository on the network
906 pull$B$7$F$7$^$&2DG=@-$O$"$k!%!K(B 983 %somewhere. While you are looking at the \hgcmd{incoming} output, and
984 %before you pull those changes, someone might have committed something in
985 %the remote repository. This means that it's possible to pull more
986 %changes than you saw when using \hgcmd{incoming}.
987
988 $B$*$=$i$/FI<T$O%M%C%H%o!<%/>e$N$I$3$+$+$i%j%]%8%H%j$r(Bpull$B$9$k$K0c$$$J$$!%(B
989 $BJQ99$r(Bpull$B$9$kA0!$(B\hgcmd{incoming}$B$N=PNO$r8+$F$$$k4V$KC/$+$,%j%b!<%H%j%](B
990 $B%8%H%j$K2?$+%3%_%C%H$9$k$3$H$bM-$jF@$k!%$3$N>l9g!$(B\hgcmd{incoming}$B$G8+$?(B
991 $B$b$N$h$j$bB?$/$NJQ99$,(Bpull$B$5$l$k$3$H$K$J$k!%(B
907 992
908 %Bringing changes into a repository is a simple matter of running the 993 %Bringing changes into a repository is a simple matter of running the
909 %\hgcmd{pull} command, and telling it which repository to pull from. 994 %\hgcmd{pull} command, and telling it which repository to pull from.
910 %\interaction{tour.pull} 995 %\interaction{tour.pull}
911 %As you can see from the before-and-after output of \hgcmd{tip}, we 996 %As you can see from the before-and-after output of \hgcmd{tip}, we
1026 %The \hgcmd{outgoing} command tells us what changes would be pushed 1111 %The \hgcmd{outgoing} command tells us what changes would be pushed
1027 %into another repository. 1112 %into another repository.
1028 %\interaction{tour.outgoing} 1113 %\interaction{tour.outgoing}
1029 %And the \hgcmd{push} command does the actual push. 1114 %And the \hgcmd{push} command does the actual push.
1030 %\interaction{tour.push} 1115 %\interaction{tour.push}
1031 %As with \hgcmd{pull}, the \hgcmd{push} command does not update the
1032 %working directory in the repository that it's pushing changes into.
1033 %(Unlike \hgcmd{pull}, \hgcmd{push} does not provide a \texttt{-u}
1034 %option that updates the other repository's working directory.)
1035 1116
1036 Mercurial$B$G$O8=:_;HMQ$7$F$$$k%j%]%8%H%j$+$iB>$N%j%]%8%H%j$KJQ99$r(Bpush$B$9$k(B 1117 Mercurial$B$G$O8=:_;HMQ$7$F$$$k%j%]%8%H%j$+$iB>$N%j%]%8%H%j$KJQ99$r(Bpush$B$9$k(B
1037 $B$3$H$,$G$-$k!%A0=R$N(B\hgcmd{pull}$B%3%^%s%I$N$h$&$K!$0l;~E*$J%j%]%8%H%j$r:n$C(B 1118 $B$3$H$,$G$-$k!%A0=R$N(B\hgcmd{pull}$B%3%^%s%I$N$h$&$K!$0l;~E*$J%j%]%8%H%j$r:n$C(B
1038 $B$F$=$3$KJQ99$r(Bpush$B$7$F$_$h$&!%(B 1119 $B$F$=$3$KJQ99$r(Bpush$B$7$F$_$h$&!%(B
1039 \interaction{tour.clone-push} 1120 \interaction{tour.clone-push}
1040 $BB>$N%j%]%8%H%j$K(Bpush$B$5$l$kJQ99$O(B\hgcmd{outgoing}$B%3%^%s%I$GCN$k$3$H$,$G$-(B 1121 $BB>$N%j%]%8%H%j$K(Bpush$B$5$l$kJQ99$O(B\hgcmd{outgoing}$B%3%^%s%I$GCN$k$3$H$,$G$-(B
1041 $B$k!%(B 1122 $B$k!%(B
1042 \interaction{tour.outgoing} 1123 \interaction{tour.outgoing}
1043 \hgcmd{push}$B%3%^%s%I$G<B:]$K(Bpush$B$r9T$&!%(B 1124 \hgcmd{push}$B%3%^%s%I$G<B:]$K(Bpush$B$r9T$&!%(B
1044 \interaction{tour.push} 1125 \interaction{tour.push}
1126
1127 %As with \hgcmd{pull}, the \hgcmd{push} command does not update the
1128 %working directory in the repository that it's pushing changes into.
1129 %Unlike \hgcmd{pull}, \hgcmd{push} does not provide a \texttt{-u} option
1130 %that updates the other repository's working directory. This asymmetry
1131 %is deliberate: the repository we're pushing to might be on a remote
1132 %server and shared between several people. If we were to update its
1133 %working directory while someone was working in it, their work would be
1134 %disrupted.
1135
1045 \hgcmd{pull}$B%3%^%s%I$HF1MM$K!$(B\hgcmd{push}$B%3%^%s%I$O(Bpush$B@h$N%j%]%8%H%j$N(B 1136 \hgcmd{pull}$B%3%^%s%I$HF1MM$K!$(B\hgcmd{push}$B%3%^%s%I$O(Bpush$B@h$N%j%]%8%H%j$N(B
1046 $B%o!<%-%s%0%G%#%l%/%H%j$N99?7$r9T$o$J$$!%!J(B\hgcmd{pull}$B%3%^%s%I$H0c$C$F(B 1137 $B%o!<%-%s%0%G%#%l%/%H%j$N99?7$r9T$o$J$$!%(B\hgcmd{pull}$B%3%^%s%I$H0c$C$F(B
1047 \hgcmd{push}$B%3%^%s%I$O!$%o!<%-%s%0%G%#%l%/%H%j$N99?7$r9T$&(B\texttt{-u}$B%*%W(B 1138 \hgcmd{push}$B%3%^%s%I$O!$%o!<%-%s%0%G%#%l%/%H%j$N99?7$r9T$&(B\texttt{-u}$B%*%W(B
1048 $B%7%g%s$r;}$?$J$$!%!K(B 1139 $B%7%g%s$r;}$?$J$$!%$3$NHsBP>N@-$O0U?^E*$J$b$N$G!$(Bpush$B@h$N%j%]%8%H%j$O%j%b!<(B
1140 $B%H%5!<%P>e$K$"$k$+$b$7$l$:!$J#?t$N%f!<%6$+$i6&M-$5$l$F$$$k2DG=@-$,$"$k!%(B
1141 $B$b$7C/$+$,:n6HCf$N%o!<%-%s%0%G%#%l%/%H%j$r99?7$7$?$i!$$=$N:n6HFbMF$OBfL5(B
1142 $B$7$K$J$C$F$7$^$&!%(B
1049 1143
1050 %What happens if we try to pull or push changes and the receiving 1144 %What happens if we try to pull or push changes and the receiving
1051 %repository already has those changes? Nothing too exciting. 1145 %repository already has those changes? Nothing too exciting.
1052 %\interaction{tour.push.nothing} 1146 %\interaction{tour.push.nothing}
1053 1147