Mercurial > hgbook
annotate ja/daily.tex @ 800:1a30d2627512
Propagate 2ff0a43f1152
Update ch03
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Thu, 18 Jun 2009 20:04:44 +0900 |
parents | 38f034c1da53 |
children | de4142983445 |
rev | line source |
---|---|
368
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
1 %\chapter{Mercurial in daily use} |
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
2 \chapter{Mercurial$B$G$NF|>o:n6H(B} |
42
cbfa08bcf181
Start the "Mercurial in daily use" chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
3 \label{chap:daily} |
cbfa08bcf181
Start the "Mercurial in daily use" chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
4 |
368
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
5 %\section{Telling Mercurial which files to track} |
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
6 \section{$BDI@W$9$Y$-%U%!%$%k$N(BMercurial$B$X$NEPO?(B} |
42
cbfa08bcf181
Start the "Mercurial in daily use" chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
7 |
376 | 8 %Mercurial does not work with files in your repository unless you tell |
9 %it to manage them. The \hgcmd{status} command will tell you which | |
10 %files Mercurial doesn't know about; it uses a ``\texttt{?}'' to | |
11 %display such files. | |
12 | |
13 Mercurial$B$O!$%f!<%6$K$h$k%U%!%$%k4IM}$N;X<($,$J$$8B$j!$%j%]%8%H%jFb$N%U%!(B | |
14 $B%$%k$G$"$C$F$b4IM}$r9T$o$J$$!%(BMercurial$B$,4IM}$7$J$$%U%!%$%k$O(B | |
15 \hgcmd{status}$B%3%^%s%I$r<B9T$9$k$H(B``\texttt{?}''$B$HI=<($5$l$k!%(B | |
42
cbfa08bcf181
Start the "Mercurial in daily use" chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
16 |
376 | 17 %To tell Mercurial to track a file, use the \hgcmd{add} command. Once |
18 %you have added a file, the entry in the output of \hgcmd{status} for | |
19 %that file changes from ``\texttt{?}'' to ``\texttt{A}''. | |
20 %\interaction{daily.files.add} | |
21 | |
22 Mercurial$B$K%U%!%$%k$NDI@W$r$5$;$k$K$O!$(B\hgcmd{add}$B%3%^%s%I$rMQ$$$k!%0lEY(B | |
23 $B%U%!%$%k$rDI2C$9$k$H!$(B\hgcmd{status}$B%3%^%s%I$N=PNO$O(B``\texttt{?}''$B$+$i(B | |
24 ``\texttt{A}''$B$KJQ$o$k!%(B | |
117
6b0f4498569e
Beef up daily routine material. Focus on merge-across-copy.
Bryan O'Sullivan <bos@serpentine.com>
parents:
43
diff
changeset
|
25 \interaction{daily.files.add} |
42
cbfa08bcf181
Start the "Mercurial in daily use" chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
26 |
376 | 27 %After you run a \hgcmd{commit}, the files that you added before the |
28 %commit will no longer be listed in the output of \hgcmd{status}. The | |
29 %reason for this is that \hgcmd{status} only tells you about | |
30 %``interesting'' files---those that you have modified or told Mercurial | |
31 %to do something with---by default. If you have a repository that | |
32 %contains thousands of files, you will rarely want to know about files | |
33 %that Mercurial is tracking, but that have not changed. (You can still | |
34 %get this information; we'll return to this later.) | |
42
cbfa08bcf181
Start the "Mercurial in daily use" chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
35 |
376 | 36 \hgcmd{commit}$B%3%^%s%I$r<B9T$9$k$H!$(Bcommit$B$NA0$KDI2C$7$?%U%!%$%k$O(B |
37 \hgcmd{status}$B$N=PNO$K8=$l$J$/$J$k!%$3$l$O!$(B\hgcmd{status}$B$,%G%U%)%k%H$G(B | |
38 $B$OJQ99$r2C$($?$j!$(BMercurial$B$K2?$+$r$5$;$?$H$$$C$?(B``$BCmL\$9$Y$-(B''$B%U%!%$%k$N(B | |
39 $B$_$rI=<($9$k$?$a$G$"$k!%?t@i$N%U%!%$%k$+$i$J$k%j%]%8%H%j$N>l9g!$(BMercurial$B$,(B | |
40 $BDI@W$7$F$$$k$b$N$N!$JQ99$N2C$($i$l$F$$$J$$%U%!%$%k$K$D$$$F2?$+$rCN$j$?$$(B | |
41 $B$H$$$&$3$H$O5)$G$"$k!%!J$b$A$m$sCN$j$?$$>l9g$O>pJs$rF@$k$3$H$b$G$-$k!%$3(B | |
42 $B$l$K$D$$$F$O8e=R$9$k!%!K(B | |
43 | |
44 %Once you add a file, Mercurial doesn't do anything with it | |
45 %immediately. Instead, it will take a snapshot of the file's state the | |
46 %next time you perform a commit. It will then continue to track the | |
47 %changes you make to the file every time you commit, until you remove | |
48 %the file. | |
49 | |
50 $BDI2C$7$?%U%!%$%k$KBP$7$F(BMercurial$B$,D>$A$K9T$&$3$H$O2?$b$J$$$,!$$=$NBe$o$j(B | |
51 $B$K<!2s$N%3%_%C%H;~$K%U%!%$%k>uBV$N%9%J%C%W%7%g%C%H$r<h$k!%$=$7$F%U%!%$%k(B | |
52 $B$r:o=|$9$k$^$G%3%_%C%HKh$K%U%!%$%k$NJQ2=$rDI@W$9$k!%(B | |
117
6b0f4498569e
Beef up daily routine material. Focus on merge-across-copy.
Bryan O'Sullivan <bos@serpentine.com>
parents:
43
diff
changeset
|
53 |
368
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
54 %\subsection{Explicit versus implicit file naming} |
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
55 \subsection{$BL@<(E*$J%U%!%$%kL?L>BP0EL[$N%U%!%$%kL?L>(B} |
42
cbfa08bcf181
Start the "Mercurial in daily use" chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
56 |
379 | 57 %A useful behaviour that Mercurial has is that if you pass the name of |
58 %a directory to a command, every Mercurial command will treat this as | |
59 %``I want to operate on every file in this directory and its | |
60 %subdirectories''. | |
61 %\interaction{daily.files.add-dir} | |
62 %Notice in this example that Mercurial printed the names of the files | |
63 %it added, whereas it didn't do so when we added the file named | |
64 %\filename{a} in the earlier example. | |
65 | |
66 Mercurial$B$NA4$F$N%3%^%s%I$O!$0z?t$H$7$F%G%#%l%/%H%jL>$rEO$9$H!$%G%#%l%/%H(B | |
67 $B%j$NFb$NA4$F$N%U%!%$%k$H%5%V%G%#%l%/%H%j$KBP$9$kA`:n$G$"$k$H2r<a$9$k$?$a(B | |
68 $BJXMx$G$"$k!%(B | |
117
6b0f4498569e
Beef up daily routine material. Focus on merge-across-copy.
Bryan O'Sullivan <bos@serpentine.com>
parents:
43
diff
changeset
|
69 \interaction{daily.files.add-dir} |
379 | 70 $B$3$NNc$G$O(BMercurial$B$ODI2C$7$?%U%!%$%kL>$rI=<($7$F$$$k$,!$A0$NNc$G(B |
71 \filename{a}$B$H$$$&L>A0$N%U%!%$%k$rDI2C$7$?:]$K$OI=<($7$F$$$J$+$C$?E@$KCm(B | |
72 $B0U$5$l$?$$!%(B | |
42
cbfa08bcf181
Start the "Mercurial in daily use" chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
73 |
379 | 74 %What's going on is that in the former case, we explicitly named the |
75 %file to add on the command line, so the assumption that Mercurial | |
76 %makes in such cases is that you know what you were doing, and it | |
77 %doesn't print any output. | |
78 | |
79 $BA0$NNc$G$O%3%^%s%I%i%$%s$G$I$N%U%!%$%k$rDI2C$9$k$N$+$rL@<(E*$K;XDj$7$?$?(B | |
80 $B$a!$(BMercurial$B$O%f!<%6$,2?$r$7$h$&$H$7$F$$$k$N$+J,$+$C$F$$$k$H?dDj$7$F2?$b(B | |
81 $BI=<($7$J$+$C$?!%(B | |
117
6b0f4498569e
Beef up daily routine material. Focus on merge-across-copy.
Bryan O'Sullivan <bos@serpentine.com>
parents:
43
diff
changeset
|
82 |
379 | 83 %However, when we \emph{imply} the names of files by giving the name of |
84 %a directory, Mercurial takes the extra step of printing the name of | |
85 %each file that it does something with. This makes it more clear what | |
86 %is happening, and reduces the likelihood of a silent and nasty | |
87 %surprise. This behaviour is common to most Mercurial commands. | |
88 | |
89 $B$7$+$7%G%#%l%/%H%jL>$rM?$($k$3$H$G%U%!%$%kL>$r0EL[E*$KM?$($?>l9g!"(B | |
90 Mercurial$B$O4XO"$9$k%U%!%$%k$NL>A0$r(B1$B$D$:$DI=<($9$kDI2C$N%9%F%C%W$rF'$`!%(B | |
91 $B$3$l$K$h$C$F2?$,5/$3$C$F$$$k$N$+M}2r$7$d$9$/$9$k$H6&$K!$D@L[N"$KLq2p$JLd(B | |
92 $BBj$,5/$3$k2DG=@-$r8:$i$7$F$$$k!%$3$N5sF0$O(BMercurial$B$NBgH>$N%3%^%s%I$K6&(B | |
93 $BDL$7$F$$$k!%(B | |
117
6b0f4498569e
Beef up daily routine material. Focus on merge-across-copy.
Bryan O'Sullivan <bos@serpentine.com>
parents:
43
diff
changeset
|
94 |
368
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
95 %\subsection{Aside: Mercurial tracks files, not directories} |
380 | 96 \subsection{$B$3$\$lOC(B: Mercurial$B$O%G%#%l%/%H%j$G$O$J$/%U%!%$%k$rDI@W$9$k(B} |
42
cbfa08bcf181
Start the "Mercurial in daily use" chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
97 |
379 | 98 %Mercurial does not track directory information. Instead, it tracks |
99 %the path to a file. Before creating a file, it first creates any | |
100 %missing directory components of the path. After it deletes a file, it | |
101 %then deletes any empty directories that were in the deleted file's | |
102 %path. This sounds like a trivial distinction, but it has one minor | |
103 %practical consequence: it is not possible to represent a completely | |
104 %empty directory in Mercurial. | |
105 | |
106 Mercurial$B$O%G%#%l%/%H%j>pJs$rDI@W$7$J$$!%$=$NBe$o$j!$%U%!%$%k$X$N%Q%9$rDI(B | |
107 $B@W$7$F$$$k!%%U%!%$%k$r:n@.$9$k:]$K$O!$$^$:%Q%9$N%G%#%l%/%H%jItJ,$rJd40$9(B | |
108 $B$k!%%U%!%$%k$r>C5n$7$?8e$O!$%U%!%$%k$N4^$^$l$F$$$?6u$N%G%#%l%/%H%j$rA4$F(B | |
109 $B>C5n$9$k!%$3$l$OEvA3$N5sF0$N$h$&$K8+$($k$,!$<B:]>e$O>.$5$JLdBj$r0z$-5/$3(B | |
110 $B$9!%$9$J$o$A!$(BMercurial$B$O40A4$K6u$N%G%#%l%/%H%j$rI=8=$9$k$3$H$,$G$-$J$$$N(B | |
111 $B$G$"$k!%(B | |
42
cbfa08bcf181
Start the "Mercurial in daily use" chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
112 |
379 | 113 %Empty directories are rarely useful, and there are unintrusive |
114 %workarounds that you can use to achieve an appropriate effect. The | |
115 %developers of Mercurial thus felt that the complexity that would be | |
116 %required to manage empty directories was not worth the limited benefit | |
117 %this feature would bring. | |
118 | |
119 $B6u$N%G%#%l%/%H%j$,M-MQ$G$"$k$3$H$OLGB?$K$J$$$,!$E,Ev$J%o!<%/%"%i%&%s%I$H(B | |
120 $B$7$F!$%j%]%8%H%j$NF0$-$rK8$2$J$$J}K!$,B8:_$9$k!%(B | |
121 Mercurial$B$N3+H/<T$?$A$O!$6u$N%G%#%l%/%H%j$rI=8=$9$k$?$a$K2C$o$kJ#;($5$O!$$=(B | |
122 $B$N5!G=$K8+9g$o$J$$$H9M$($?!%(B | |
42
cbfa08bcf181
Start the "Mercurial in daily use" chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
123 |
379 | 124 %If you need an empty directory in your repository, there are a few |
125 %ways to achieve this. One is to create a directory, then \hgcmd{add} a | |
126 %``hidden'' file to that directory. On Unix-like systems, any file | |
127 %name that begins with a period (``\texttt{.}'') is treated as hidden | |
128 %by most commands and GUI tools. This approach is illustrated in | |
129 %figure~\ref{ex:daily:hidden}. | |
130 | |
131 $B%j%]%8%H%j$K6u$N%G%#%l%/%H%j$,I,MW$J>l9g!$$3$l$r<B8=$9$kJ}K!$,$$$/$D$+$"(B | |
132 $B$k!%(B1$B$DL\$O!$$^$:%G%#%l%/%H%j$r:n@.$7!$1#$7%U%!%$%k$r$3$N%G%#%l%/%H%jFb$K(B | |
133 \hgcmd{add}$B$9$k!%(BUnix$B7O%7%9%F%`$G$O!$%T%j%*%I(B(``\texttt{.}'')$B$G;O$^$k%U%!(B | |
134 $B%$%k$OBgH>$N%3%^%s%I$H(BGUI$B%D!<%k$G1#$7%U%!%$%k$H$7$F<h$j07$o$l$k!%(B | |
135 $B>\:Y$K$D$$$F$O?^(B~\ref{ex:daily:hidden}$B$r;2>H$5$l$?$$!%(B | |
42
cbfa08bcf181
Start the "Mercurial in daily use" chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
136 |
cbfa08bcf181
Start the "Mercurial in daily use" chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
137 \begin{figure}[ht] |
43 | 138 \interaction{daily.files.hidden} |
379 | 139 % \caption{Simulating an empty directory using a hidden file} |
140 \caption{$B1#$7%U%!%$%k$r;H$C$F6u$N%G%#%l%/%H%j$r%7%_%e%l!<%H$9$k(B} | |
43 | 141 \label{ex:daily:hidden} |
42
cbfa08bcf181
Start the "Mercurial in daily use" chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
142 \end{figure} |
cbfa08bcf181
Start the "Mercurial in daily use" chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
143 |
379 | 144 %Another way to tackle a need for an empty directory is to simply |
145 %create one in your automated build scripts before they will need it. | |
146 | |
147 $B6u$N%G%#%l%/%H%j$r07$&JL$NJ}K!$K$O!$<+F0%S%k%I%9%/%j%W%H$NCf$G!$I,MW$K$J$k(B | |
148 $BA0$K:n@.$9$k$3$H$,$"$k!%(B | |
42
cbfa08bcf181
Start the "Mercurial in daily use" chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
149 |
368
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
150 %\section{How to stop tracking a file} |
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
151 \section{$B%U%!%$%kDI@W$NDd;_(B} |
42
cbfa08bcf181
Start the "Mercurial in daily use" chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
152 |
380 | 153 %Once you decide that a file no longer belongs in your repository, use |
154 %the \hgcmd{remove} command; this deletes the file, and tells Mercurial | |
155 %to stop tracking it. A removed file is represented in the output of | |
156 %\hgcmd{status} with a ``\texttt{R}''. | |
157 %\interaction{daily.files.remove} | |
158 | |
159 $B%U%!%$%k$,%j%]%8%H%j$KI,MW$J$/$J$C$?;~$O(B\hgcmd{remove}$B%3%^%s%I$r<B9T$9(B | |
160 $B$k!%$3$N%3%^%s%I$O%U%!%$%k$r:o=|$7$?>e$G(BMercurial$B$K%U%!%$%kDI@W$NDd;_$r;X(B | |
161 $B<($9$k!%:o=|$5$l$?%U%!%$%k$O(B\hgcmd{status}$B%3%^%s%I$N=PNO$G(B``\texttt{R}'' | |
162 $B$HI=<($5$l$k!%(B | |
117
6b0f4498569e
Beef up daily routine material. Focus on merge-across-copy.
Bryan O'Sullivan <bos@serpentine.com>
parents:
43
diff
changeset
|
163 \interaction{daily.files.remove} |
42
cbfa08bcf181
Start the "Mercurial in daily use" chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
164 |
380 | 165 %After you \hgcmd{remove} a file, Mercurial will no longer track |
166 %changes to that file, even if you recreate a file with the same name | |
167 %in your working directory. If you do recreate a file with the same | |
168 %name and want Mercurial to track the new file, simply \hgcmd{add} it. | |
169 %Mercurial will know that the newly added file is not related to the | |
170 %old file of the same name. | |
171 | |
172 $B0lEY%U%!%$%k$r(B\hgcmd{remove}$B$7$?8e$G$O!$(BMercurial$B$O%o!<%-%s%0%G%#%l%/%H%j(B | |
173 $BFb$K$?$H$(F1$8L>A0$G%U%!%$%k$,:F@8@.$5$l$F$b%U%!%$%k$X$NJQ99$rDI@W$7$J$$!%(B | |
174 $B%U%!%$%k$r:F@8@.$7!$(BMercurial$B$KDI@W$5$;$?$$$N$G$"$l$P!$(B\hgcmd{add}$B$r9T$&!%(B | |
175 Mercurial$B$O!$?75,$KDI2C$5$l$?%U%!%$%k$rF1L>$N8E$$%U%!%$%k$H4X78$J$/07$&!%(B | |
118
1ee53cb37a99
More progress on daily work.
Bryan O'Sullivan <bos@serpentine.com>
parents:
117
diff
changeset
|
176 |
368
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
177 %\subsection{Removing a file does not affect its history} |
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
178 \subsection{$B%U%!%$%k:o=|$OMzNr$K1F6A$rM?$($J$$(B} |
118
1ee53cb37a99
More progress on daily work.
Bryan O'Sullivan <bos@serpentine.com>
parents:
117
diff
changeset
|
179 |
380 | 180 %It is important to understand that removing a file has only two |
181 %effects. | |
182 $B%U%!%$%k$N:o=|$,%j%]%8%H%j$KM?$($k1F6A$O(B2$B$D$N$_$G$"$k!%(B | |
118
1ee53cb37a99
More progress on daily work.
Bryan O'Sullivan <bos@serpentine.com>
parents:
117
diff
changeset
|
183 \begin{itemize} |
380 | 184 %\item It removes the current version of the file from the working |
185 % directory. | |
186 \item $B%o!<%-%s%0%G%#%l%/%H%j$+$i869F$N%P!<%8%g%s$N%U%!%$%k$r>C5n$9$k!%(B | |
187 %\item It stops Mercurial from tracking changes to the file, from the | |
188 % time of the next commit. | |
189 \item $B:o=|$9$k%U%!%$%k$X$NJQ99$r<!2s$N%3%_%C%H$+$i(BMercurial$B$,DI@W$7$J$$(B | |
190 $B$h$&$K$9$k!%(B | |
118
1ee53cb37a99
More progress on daily work.
Bryan O'Sullivan <bos@serpentine.com>
parents:
117
diff
changeset
|
191 \end{itemize} |
380 | 192 %Removing a file \emph{does not} in any way alter the \emph{history} of |
193 %the file. | |
194 $B%U%!%$%k$r$I$N$h$&$K:o=|$7$F$b%U%!%$%k$N(B\emph{$BMzNr(B}$B$OJQ99(B\emph{$B$5$l$J$$(B}$B!%(B | |
118
1ee53cb37a99
More progress on daily work.
Bryan O'Sullivan <bos@serpentine.com>
parents:
117
diff
changeset
|
195 |
380 | 196 %If you update the working directory to a changeset in which a file |
197 %that you have removed was still tracked, it will reappear in the | |
198 %working directory, with the contents it had when you committed that | |
199 %changeset. If you then update the working directory to a later | |
200 %changeset, in which the file had been removed, Mercurial will once | |
201 %again remove the file from the working directory. | |
202 | |
203 $B%o!<%-%s%0%G%#%l%/%H%j$r!$>C5n$7$?%U%!%$%k$r4^$`%A%'%s%8%;%C%H$K99?7$9$k(B | |
204 $B$H!$%U%!%$%k$O$=$N%A%'%s%8%;%C%H$G$NFbMF$G:F$S%o!<%-%s%0%G%#%l%/%H%j$K8=(B | |
205 $B$l$k!%$=$3$G%U%!%$%k$,>C5n$5$l$F$$$k8e$N%A%'%s%8%;%C%H$K99?7$9$k(B | |
206 $B$H!$(BMercurial$B$O%U%!%$%k$r:F$S%o!<%-%s%0%G%#%l%/%H%j$+$i>C5n$9$k!%(B | |
118
1ee53cb37a99
More progress on daily work.
Bryan O'Sullivan <bos@serpentine.com>
parents:
117
diff
changeset
|
207 |
368
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
208 %\subsection{Missing files} |
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
209 \subsection{$B7gMn$7$?%U%!%$%k(B} |
42
cbfa08bcf181
Start the "Mercurial in daily use" chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
210 |
380 | 211 %Mercurial considers a file that you have deleted, but not used |
212 %\hgcmd{remove} to delete, to be \emph{missing}. A missing file is | |
213 %represented with ``\texttt{!}'' in the output of \hgcmd{status}. | |
214 %Mercurial commands will not generally do anything with missing files. | |
215 %\interaction{daily.files.missing} | |
216 | |
217 Mercurial$B$O!$(B\hgcmd{remove}$B$r;H$o$:$K>C5n$5$l$?%U%!%$%k$r(B\emph{$B7gMn(B}$B$7$?(B | |
218 $B%U%!%$%k$H$7$F07$&!%7gMn%U%!%$%k$O(B\hgcmd{status}$B%3%^%s%I$N=PNO$G(B | |
219 ``\texttt{!}''$B$HI=<($5$l$k!%(BMercurial$B$N%3%^%s%I$O!$DL>o!$7gMn$7$?%U%!%$(B | |
220 $B%k$K$O2?$b9T$o$J$$!%(B | |
117
6b0f4498569e
Beef up daily routine material. Focus on merge-across-copy.
Bryan O'Sullivan <bos@serpentine.com>
parents:
43
diff
changeset
|
221 \interaction{daily.files.missing} |
6b0f4498569e
Beef up daily routine material. Focus on merge-across-copy.
Bryan O'Sullivan <bos@serpentine.com>
parents:
43
diff
changeset
|
222 |
380 | 223 %If your repository contains a file that \hgcmd{status} reports as |
224 %missing, and you want the file to stay gone, you can run | |
225 %\hgcmdargs{remove}{\hgopt{remove}{--after}} at any time later on, to | |
226 %tell Mercurial that you really did mean to remove the file. | |
227 %\interaction{daily.files.remove-after} | |
228 | |
229 $B%j%]%8%H%jFb$G(B\hgcmd{status}$B%3%^%s%I$,7gMn$H%j%]!<%H$9$k%U%!%$%k$,$"$k>l(B | |
230 $B9g!$(B\hgcmdargs{remove}{\hgopt{remove}{--after}}$B$r<B9T$7$F!$(BMercurial$B$K7g(B | |
231 $BMn%U%!%$%k$,>C5n$5$l$?$b$N$G$"$k$3$H$r;X<($9$k$3$H$,$G$-$k!%(B | |
117
6b0f4498569e
Beef up daily routine material. Focus on merge-across-copy.
Bryan O'Sullivan <bos@serpentine.com>
parents:
43
diff
changeset
|
232 \interaction{daily.files.remove-after} |
43 | 233 |
380 | 234 %On the other hand, if you deleted the missing file by accident, use |
235 %\hgcmdargs{revert}{\emph{filename}} to recover the file. It will | |
236 %reappear, in unmodified form. | |
237 %\interaction{daily.files.recover-missing} | |
238 | |
239 $B0lJ}$G!$8m$C$F%U%!%$%k$r>C5n$7$?>l9g!$(B\hgcmdargs{revert}{\emph{filename}}$B$r(B | |
240 $B<B9T$9$k$3$H$G%U%!%$%k$r=$I|$9$k$3$H$,$G$-$k!%%U%!%$%k$O2?$bJQ99$5$l$J$$>uBV(B | |
241 $B$G=$I|$5$l$k!%(B | |
117
6b0f4498569e
Beef up daily routine material. Focus on merge-across-copy.
Bryan O'Sullivan <bos@serpentine.com>
parents:
43
diff
changeset
|
242 \interaction{daily.files.recover-missing} |
6b0f4498569e
Beef up daily routine material. Focus on merge-across-copy.
Bryan O'Sullivan <bos@serpentine.com>
parents:
43
diff
changeset
|
243 |
368
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
244 %\subsection{Aside: why tell Mercurial explicitly to remove a file?} |
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
245 \subsection{$B$3$\$lOC(B: $B$J$<(BMercurial$B$X%U%!%$%k$N:o=|$rL@<(E*$K;X<($7$J$1(B |
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
246 $B$l$P$J$i$J$$$+(B} |
42
cbfa08bcf181
Start the "Mercurial in daily use" chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
247 |
380 | 248 %You might wonder why Mercurial requires you to explicitly tell it that |
249 %you are deleting a file. Early during the development of Mercurial, | |
250 %it let you delete a file however you pleased; Mercurial would notice | |
251 %the absence of the file automatically when you next ran a | |
252 %\hgcmd{commit}, and stop tracking the file. In practice, this made it | |
253 %too easy to accidentally remove a file without noticing. | |
254 | |
255 $B$J$<(BMercurial$B$K%U%!%$%k$N:o=|$rL@<(E*$K;X<($7$J$1$l$P$J$i$J$$$N$@$m$&$+!)(B | |
256 Mercurial$B$N3+H/$N=i4|$K$O!$%U%!%$%k$,$J$$$3$H$r8!CN$9$k$H!$<!$K(B | |
257 \hgcmd{commit}$B$,<B9T$5$l$k;~$K<+F0E*$K%U%!%$%k$NDI@W$r$d$a$F$$$?!%<B:]$K(B | |
258 $B;H$C$F$_$k$H$3$NF0:n$G$O%U%!%$%k$rCN$i$:$N$&$A$K<:$&$3$H$,IQH/$7$?$N$G$"(B | |
259 $B$k!%(B | |
117
6b0f4498569e
Beef up daily routine material. Focus on merge-across-copy.
Bryan O'Sullivan <bos@serpentine.com>
parents:
43
diff
changeset
|
260 |
368
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
261 %\subsection{Useful shorthand---adding and removing files in one step} |
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
262 \subsection{$BLr$KN)$D4JN,K!(B---$B%U%!%$%k$NDI2C$H:o=|$r(B1$B%9%F%C%W$G9T$&(B} |
42
cbfa08bcf181
Start the "Mercurial in daily use" chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
263 |
380 | 264 %Mercurial offers a combination command, \hgcmd{addremove}, that adds |
265 %untracked files and marks missing files as removed. | |
266 %\interaction{daily.files.addremove} | |
267 %The \hgcmd{commit} command also provides a \hgopt{commit}{-A} option | |
268 %that performs this same add-and-remove, immediately followed by a | |
269 %commit. | |
270 %\interaction{daily.files.commit-addremove} | |
271 | |
272 Mercurial$B$O(B\hgcmd{addremove}$B$H$$$&AH$_9g$o$;%3%^%s%I$r;}$C$F$$$k!%$3$N%3(B | |
273 $B%^%s%I$ODI@W$5$l$F$$$J$$%U%!%$%k72$rDI2C$7!$7gMn$7$F$$$k%U%!%$%k$r>C5n$5(B | |
274 $B$l$?$H%^!<%/$9$k!%(B | |
117
6b0f4498569e
Beef up daily routine material. Focus on merge-across-copy.
Bryan O'Sullivan <bos@serpentine.com>
parents:
43
diff
changeset
|
275 \interaction{daily.files.addremove} |
380 | 276 \hgcmd{commit}$B%3%^%s%I$K$O(B\hgopt{commit}{-A}$B%*%W%7%g%s$,$"$j!$F1$8DI2C$H(B |
277 $B:o=|$NA`:n$r%3%_%C%HD>8e$K9T$&!%(B | |
117
6b0f4498569e
Beef up daily routine material. Focus on merge-across-copy.
Bryan O'Sullivan <bos@serpentine.com>
parents:
43
diff
changeset
|
278 \interaction{daily.files.commit-addremove} |
6b0f4498569e
Beef up daily routine material. Focus on merge-across-copy.
Bryan O'Sullivan <bos@serpentine.com>
parents:
43
diff
changeset
|
279 |
368
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
280 %\section{Copying files} |
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
281 \section{$B%U%!%$%k$N%3%T!<(B} |
117
6b0f4498569e
Beef up daily routine material. Focus on merge-across-copy.
Bryan O'Sullivan <bos@serpentine.com>
parents:
43
diff
changeset
|
282 |
368
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
283 %Mercurial provides a \hgcmd{copy} command that lets you make a new |
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
284 %copy of a file. When you copy a file using this command, Mercurial |
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
285 %makes a record of the fact that the new file is a copy of the original |
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
286 %file. It treats these copied files specially when you merge your work |
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
287 %with someone else's. |
117
6b0f4498569e
Beef up daily routine material. Focus on merge-across-copy.
Bryan O'Sullivan <bos@serpentine.com>
parents:
43
diff
changeset
|
288 |
368
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
289 Mercurial$B$K$O!$%U%!%$%k$N?7$7$$%3%T!<$r:n$k(B\hgcmd{copy}$B%3%^%s%I$,$"$k!%(B |
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
290 $B$3$N%3%^%s%I$r;H$C$F%U%!%$%k$r%3%T!<$9$k$H!$(BMercurial$B$O?7$7$$%U%!%$%k$,(B |
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
291 $B%*%j%8%J%k$NJ#@=$G$"$k$3$H$r5-O?$9$k!%J#@=$5$l$?%U%!%$%k$O!$JL$N?M$K$h$k(B |
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
292 $BJQ99$r%^!<%8$9$k;~$KFCJL$J<h$j07$$$,$J$5$l$k!%(B |
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
293 |
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
294 %\subsection{The results of copying during a merge} |
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
295 \subsection{$B%^!<%8Cf$N%3%T!<$N7k2L(B} |
121
9094c9fda8ec
Start chapter on error recovery.
Bryan O'Sullivan <bos@serpentine.com>
parents:
118
diff
changeset
|
296 |
380 | 297 %What happens during a merge is that changes ``follow'' a copy. To |
298 %best illustrate what this means, let's create an example. We'll start | |
299 %with the usual tiny repository that contains a single file. | |
300 %\interaction{daily.copy.init} | |
301 %We need to do some work in parallel, so that we'll have something to | |
302 %merge. So let's clone our repository. | |
303 %\interaction{daily.copy.clone} | |
304 %Back in our initial repository, let's use the \hgcmd{copy} command to | |
305 %make a copy of the first file we created. | |
306 %\interaction{daily.copy.copy} | |
307 | |
308 $B%^!<%8Cf$K$O!$%3%T!<$K(B``$B=>$&(B''$B$3$H$,5/$-$k!%$3$l$N0UL#$9$k$H$3$m$r<($9$?(B | |
309 $B$a$K!$Nc$r5s$2$k$3$H$K$9$k!%$$$D$b$N$h$&$K!$%U%!%$%k(B1$B$D$@$1$r4^$`>.$5$J%j(B | |
310 $B%]%8%H%j$r:n@.$9$k!%(B | |
117
6b0f4498569e
Beef up daily routine material. Focus on merge-across-copy.
Bryan O'Sullivan <bos@serpentine.com>
parents:
43
diff
changeset
|
311 \interaction{daily.copy.init} |
380 | 312 $B%^!<%8$9$Y$-FbMF$r:n$k$?$a$KJB9T$7$F$$$/$D$+$N:n6H$r9T$&I,MW$,$"$k$N$G!$(B |
313 $B%j%]%8%H%j$N%/%m!<%s$r9T$&!%(B | |
117
6b0f4498569e
Beef up daily routine material. Focus on merge-across-copy.
Bryan O'Sullivan <bos@serpentine.com>
parents:
43
diff
changeset
|
314 \interaction{daily.copy.clone} |
380 | 315 $B:G=i$N%j%]%8%H%j$KLa$C$F!$(B\hgcmd{copy}$B%3%^%s%I$r;H$C$F!$:n@.$7$?%U%!%$%k(B |
316 $B$N%3%T!<$r9T$&!%(B | |
117
6b0f4498569e
Beef up daily routine material. Focus on merge-across-copy.
Bryan O'Sullivan <bos@serpentine.com>
parents:
43
diff
changeset
|
317 \interaction{daily.copy.copy} |
6b0f4498569e
Beef up daily routine material. Focus on merge-across-copy.
Bryan O'Sullivan <bos@serpentine.com>
parents:
43
diff
changeset
|
318 |
380 | 319 %If we look at the output of the \hgcmd{status} command afterwards, the |
320 %copied file looks just like a normal added file. | |
321 %\interaction{daily.copy.status} | |
322 %But if we pass the \hgopt{status}{-C} option to \hgcmd{status}, it | |
323 %prints another line of output: this is the file that our newly-added | |
324 %file was copied \emph{from}. | |
325 %\interaction{daily.copy.status-copy} | |
326 | |
327 $B$=$N8e$G(B\hgcmd{status}$B%3%^%s%I$N=PNO$r8+$k$H%3%T!<$5$l$?%U%!%$%k$ODL>oDL(B | |
328 $B$j$KDI2C$5$l$?%U%!%$%k$H$7$F8+$($k!%(B | |
117
6b0f4498569e
Beef up daily routine material. Focus on merge-across-copy.
Bryan O'Sullivan <bos@serpentine.com>
parents:
43
diff
changeset
|
329 \interaction{daily.copy.status} |
380 | 330 $B$7$+$7(B\hgcmd{status}$B%3%^%s%I$K(B\hgopt{status}{-C}$B%*%W%7%g%s$rEO$9$H!$?7$?(B |
331 $B$KDI2C$5$l$?%U%!%$%k$,(B\emph{$B$I$N(B}$B%U%!%$%k$+$i%3%T!<$5$l$?$N$+$r<($99T$,(B | |
332 $B=PNO$5$l$k!%(B | |
117
6b0f4498569e
Beef up daily routine material. Focus on merge-across-copy.
Bryan O'Sullivan <bos@serpentine.com>
parents:
43
diff
changeset
|
333 \interaction{daily.copy.status-copy} |
6b0f4498569e
Beef up daily routine material. Focus on merge-across-copy.
Bryan O'Sullivan <bos@serpentine.com>
parents:
43
diff
changeset
|
334 |
380 | 335 %Now, back in the repository we cloned, let's make a change in |
336 %parallel. We'll add a line of content to the original file that we | |
337 %created. | |
338 %\interaction{daily.copy.other} | |
339 %Now we have a modified \filename{file} in this repository. When we | |
340 %pull the changes from the first repository, and merge the two heads, | |
341 %Mercurial will propagate the changes that we made locally to | |
342 %\filename{file} into its copy, \filename{new-file}. | |
343 %\interaction{daily.copy.merge} | |
344 | |
345 $B$3$3$G%/%m!<%s$7$?%j%]%8%H%j$K$bJQ99$r2C$($k!%:n@.$7$?%U%!%$%k$K0l9T$rDI(B | |
346 $B2C$9$k!%(B | |
117
6b0f4498569e
Beef up daily routine material. Focus on merge-across-copy.
Bryan O'Sullivan <bos@serpentine.com>
parents:
43
diff
changeset
|
347 \interaction{daily.copy.other} |
380 | 348 $B$3$l$G$3$N%j%]%8%H%j$K$bJQ99$5$l$?(B\filename{file}$B$,B8:_$9$k$3$H$K$J(B |
349 $B$k!%$3$3$G:G=i$N%j%]%8%H%j$+$iJQ99$r(Bpull$B$7!$(B2$B$D$N(Bhead$B$r%^!<%8$9$k$H(B | |
350 Mercurial$B$O%m!<%+%k$J(B\filename{file}$B$KBP$9$kJQ99$r$=$N%3%T!<(B | |
351 \filename{new-file}$B$KGH5Z$5$;$k!%(B | |
117
6b0f4498569e
Beef up daily routine material. Focus on merge-across-copy.
Bryan O'Sullivan <bos@serpentine.com>
parents:
43
diff
changeset
|
352 \interaction{daily.copy.merge} |
6b0f4498569e
Beef up daily routine material. Focus on merge-across-copy.
Bryan O'Sullivan <bos@serpentine.com>
parents:
43
diff
changeset
|
353 |
368
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
354 %\subsection{Why should changes follow copies?} |
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
355 \subsection{$BJQ99$O$J$<%3%T!<$K=>$o$J$1$l$P$J$i$J$$$+(B} |
117
6b0f4498569e
Beef up daily routine material. Focus on merge-across-copy.
Bryan O'Sullivan <bos@serpentine.com>
parents:
43
diff
changeset
|
356 \label{sec:daily:why-copy} |
6b0f4498569e
Beef up daily routine material. Focus on merge-across-copy.
Bryan O'Sullivan <bos@serpentine.com>
parents:
43
diff
changeset
|
357 |
380 | 358 %This behaviour, of changes to a file propagating out to copies of the |
359 %file, might seem esoteric, but in most cases it's highly desirable. | |
360 | |
361 $B%U%!%$%k$X$NJQ99$,$=$N%3%T!<$XGH5Z$9$kF0:n$OFq2r$K;W$($k$+$b$7$J$$$,!$B?(B | |
362 $B$/$N>l9g$OHs>o$KK>$^$7$$F0:n$G$"$k!%(B | |
363 | |
364 %First of all, remember that this propagation \emph{only} happens when | |
365 %you merge. So if you \hgcmd{copy} a file, and subsequently modify the | |
366 %original file during the normal course of your work, nothing will | |
367 %happen. | |
117
6b0f4498569e
Beef up daily routine material. Focus on merge-across-copy.
Bryan O'Sullivan <bos@serpentine.com>
parents:
43
diff
changeset
|
368 |
380 | 369 $B$^$:Bh0l$K$3$NGH5Z$O%^!<%8$r9T$&$H$-$K(B\emph{$B$N$_(B}$BH/@8$9$k!%=>$C$F%U%!%$%k(B |
370 $B$r(B\hgcmd{copy}$B$9$k>l9g$d!$DL>o$N:n6H$G%*%j%8%J%k%U%!%$%k$rJQ99$9$k>l9g$O(B | |
371 $B2?$b5/$-$J$$!%(B | |
372 | |
373 %The second thing to know is thatmodifications will only propagate | |
374 %across a copy as long as the repository that you're pulling changes | |
375 %from \emph{doesn't know} about the copy. | |
42
cbfa08bcf181
Start the "Mercurial in daily use" chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
376 |
380 | 377 $BCN$C$F$*$/$Y$-E@$N(B2$B$DL\$O!$JQ99$r(Bpull$B$9$k%j%]%8%H%j$,!$%3%T!<$K$D$$$F(B |
378 \emph{$B4XCN$7$J$$(B}$B8B$j!$JQ99$OGH5Z$9$k$H$$$&$3$H$G$"$k!%(B | |
379 | |
380 %The reason that Mercurial does this is as follows. Let's say I make | |
381 %an important bug fix in a source file, and commit my changes. | |
382 %Meanwhile, you've decided to \hgcmd{copy} the file in your repository, | |
383 %without knowing about the bug or having seen the fix, and you have | |
384 %started hacking on your copy of the file. | |
117
6b0f4498569e
Beef up daily routine material. Focus on merge-across-copy.
Bryan O'Sullivan <bos@serpentine.com>
parents:
43
diff
changeset
|
385 |
380 | 386 Mercurial$B$,$3$N$h$&$KF0:n$9$kM}M3$r@bL@$9$k!%:#!$;d$,=EMW$J%P%0=$@5$r(B1$B$D(B |
387 $B$N%=!<%9%U%!%$%k$K$D$$$F9T$$!$JQ99$r%3%_%C%H$7$?$H$9$k!%$=$N4V!$$"$J$?$O(B | |
388 $B<+J,$N%j%]%8%H%j$NCf$G!$$=$N%P%0$"$k$$$O=$@5$rCN$i$:!$$=$N%U%!%$%k$N(B | |
389 \hgcmd{copy}$B$r9T$$!$%U%!%$%k$NJQ99$r;O$a$?$H$9$k!%(B | |
117
6b0f4498569e
Beef up daily routine material. Focus on merge-across-copy.
Bryan O'Sullivan <bos@serpentine.com>
parents:
43
diff
changeset
|
390 |
380 | 391 %If you pulled and merged my changes, and Mercurial \emph{didn't} |
392 %propagate changes across copies, your source file would now contain | |
393 %the bug, and unless you remembered to propagate the bug fix by hand, | |
394 %the bug would \emph{remain} in your copy of the file. | |
395 | |
396 $B$"$J$?$,;d$N9T$C$?JQ99$r(Bpull$B$7!$(Bmerge$B$7$?>l9g!$(BMercurial$B$OJQ99$r%3%T!<4V(B | |
397 $B$GGH5Z$5$;$J$$!%$"$J$?$N%=!<%9%U%!%$%k:#%P%0$r;}$C$F$$$k$+$b$7$l$J$$$,!$(B | |
398 $B%P%0=$@5$r<j$GGH5Z$5$;$J$1$l$P%P%0$O%U%!%$%k$N%3%T!<$K(B\emph{$B;D$k(B}$B!%(B | |
117
6b0f4498569e
Beef up daily routine material. Focus on merge-across-copy.
Bryan O'Sullivan <bos@serpentine.com>
parents:
43
diff
changeset
|
399 |
380 | 400 %By automatically propagating the change that fixed the bug from the |
401 %original file to the copy, Mercurial prevents this class of problem. | |
402 %To my knowledge, Mercurial is the \emph{only} revision control system | |
403 %that propagates changes across copies like this. | |
404 | |
405 $B%P%0$r=$@5$9$kJQ99$r<+F0E*$K%*%j%8%J%k%U%!%$%k$+$i%3%T!<$XGH5Z$5$;$k$3$H(B | |
406 $B$K$h$C$F!$(BMercurial$B$O$3$NN`$NLdBj$rHr$1$F$$$k!%;d$NCN$k8B(B | |
407 $B$j!$(BMercurial$B$O!$$3$N$h$&$J%3%T!<4V$GJQ99$rGH5Z$5$;$kM#0l$N%j%S%8%g%s%3%s(B | |
408 $B%H%m!<%k%7%9%F%`$G$"$k!%(B | |
117
6b0f4498569e
Beef up daily routine material. Focus on merge-across-copy.
Bryan O'Sullivan <bos@serpentine.com>
parents:
43
diff
changeset
|
409 |
380 | 410 %Once your change history has a record that the copy and subsequent |
411 %merge occurred, there's usually no further need to propagate changes | |
412 %from the original file to the copied file, and that's why Mercurial | |
413 %only propagates changes across copies until this point, and no | |
414 %further. | |
415 | |
416 $B%3%T!<$H8eB3$N%^!<%8$,5/$3$C$?$3$H$,99?7MzNr$K4^$^$l$k>l9g!$JQ99$r%*%j%8(B | |
417 $B%J%k%U%!%$%k$+$i%3%T!<$5$l$?%U%!%$%k$X$5$i$KGH5Z$5$;$kI,MW$O$J$$!%$3$l$,(B | |
418 Mercurial$B$,$3$N;~E@$^$G$N$_JQ99$r%3%T!<4V$GGH5Z$5$;!$$=$N8e$G$O9T$o$J$$M}(B | |
419 $BM3$G$"$k!%(B | |
117
6b0f4498569e
Beef up daily routine material. Focus on merge-across-copy.
Bryan O'Sullivan <bos@serpentine.com>
parents:
43
diff
changeset
|
420 |
368
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
421 %\subsection{How to make changes \emph{not} follow a copy} |
380 | 422 \subsection{$BJQ99$,%3%T!<$K=>$o$J$$$h$&$K$9$kJ}K!(B} |
117
6b0f4498569e
Beef up daily routine material. Focus on merge-across-copy.
Bryan O'Sullivan <bos@serpentine.com>
parents:
43
diff
changeset
|
423 |
380 | 424 %If, for some reason, you decide that this business of automatically |
425 %propagating changes across copies is not for you, simply use your | |
426 %system's normal file copy command (on Unix-like systems, that's | |
427 %\command{cp}) to make a copy of a file, then \hgcmd{add} the new copy | |
428 %by hand. Before you do so, though, please do reread | |
429 %section~\ref{sec:daily:why-copy}, and make an informed decision that | |
430 %this behaviour is not appropriate to your specific case. | |
431 | |
432 $B2?$i$+$NM}M3$G$3$N$h$&$KJQ99$,<+F0E*$KGH5Z$9$k$d$jJ}$,9%$^$7$/$J$$$H;W$o(B | |
433 $B$l$k>l9g$O!$%7%9%F%`I8=`$N$"%U%!%$%k%3%T!<%3%^%s%I!J(BUNIX$B7O%7%9%F%`$G$O(B | |
434 \command{cp}$B!K$r;H$C$F%U%!%$%k$N%3%T!<$r9T$$!$(B\hgcmd{add}$B$G?7$7$$%3%T!<$r(B | |
435 $B<jF0$GDI2C$9$k$3$H$,$G$-$k!%$3$l$r<B:]$K9T$&A0(B | |
436 $B$K!$(B~\ref{sec:daily:why-copy}$B@a$r:FFI$7!$$3$N$d$jJ}$N>\:Y$rF'$^$($?>e$G!$(B | |
437 $B$"$J$?$N%1!<%9$KE,$7$F$$$k$+H=CG$7$F$[$7$$!%(B | |
117
6b0f4498569e
Beef up daily routine material. Focus on merge-across-copy.
Bryan O'Sullivan <bos@serpentine.com>
parents:
43
diff
changeset
|
438 |
368
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
439 %\subsection{Behaviour of the \hgcmd{copy} command} |
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
440 \subsection{\hgcmd{copy}$B%3%^%s%I$N5sF0(B} |
117
6b0f4498569e
Beef up daily routine material. Focus on merge-across-copy.
Bryan O'Sullivan <bos@serpentine.com>
parents:
43
diff
changeset
|
441 |
380 | 442 %When you use the \hgcmd{copy} command, Mercurial makes a copy of each |
443 %source file as it currently stands in the working directory. This | |
444 %means that if you make some modifications to a file, then \hgcmd{copy} | |
445 %it without first having committed those changes, the new copy will | |
446 %also contain the modifications you have made up until that point. (I | |
447 %find this behaviour a little counterintuitive, which is why I mention | |
448 %it here.) | |
449 | |
450 \hgcmd{copy}$B%3%^%s%I$r;H$&;~!$(BMercurial$B$O%o!<%-%s%0%G%#%l%/%H%jFb$N%U%!%$(B | |
451 $B%k$r$=$N;~E@$N>uBV$G%3%T!<$9$k!%$9$J$o$A!$%U%!%$%k$K2?$i$+$NJQ99$r2C$(!$(B | |
452 $BJQ99$N%3%_%C%H$r$;$:$K(B\hgcmd{copy}$B$r9T$&$H!$?7$?$J%3%T!<$b$=$N;~E@$^$G$K(B | |
453 $B2C$($?JQ99$r4^$s$G$$$k!%(B $B!JI.<T$O$3$N5sF0$O$d$dD>4Q$KH?$9$k$H9M$($F$$$k$?(B | |
454 $B$a!$4:$($F$3$3$G8@5Z$7$?!%!K(B | |
118
1ee53cb37a99
More progress on daily work.
Bryan O'Sullivan <bos@serpentine.com>
parents:
117
diff
changeset
|
455 |
380 | 456 %The \hgcmd{copy} command acts similarly to the Unix \command{cp} |
457 %command (you can use the \hgcmd{cp} alias if you prefer). The last | |
458 %argument is the \emph{destination}, and all prior arguments are | |
459 %\emph{sources}. If you pass it a single file as the source, and the | |
460 %destination does not exist, it creates a new file with that name. | |
461 %\interaction{daily.copy.simple} | |
462 %If the destination is a directory, Mercurial copies its sources into | |
463 %that directory. | |
464 %\interaction{daily.copy.dir-dest} | |
465 %Copying a directory is recursive, and preserves the directory | |
466 %structure of the source. | |
467 %\interaction{daily.copy.dir-src} | |
468 %If the source and destination are both directories, the source tree is | |
469 %recreated in the destination directory. | |
470 %\interaction{daily.copy.dir-src-dest} | |
471 | |
472 \hgcmd{copy}$B%3%^%s%I$O(BUnix$B$N(B\command{cp}$B$HF1MM$K?6Iq$&!%!J(B\hgcmd{cp}$B%(%$(B | |
473 $B%j%"%9$rDj5A$7$F;H$&$3$H$b2DG=$@!%!K0z?t$N:G8e$O(B\emph{$B%3%T!<@h(B}$B$G!$$=$l0J(B | |
474 $BA0$N0z?t$O(B\emph{$B%3%T!<85(B}$B$G$"$k!%%3%T!<85$H$7$FC10l$N%U%!%$%k$r;XDj$7!$%3(B | |
475 $B%T!<@h%U%!%$%k$,B8:_$7$J$$>l9g!$%3%^%s%I$O%3%T!<@h%U%!%$%k$r?75,$K:n@.$9(B | |
476 $B$k!%(B | |
117
6b0f4498569e
Beef up daily routine material. Focus on merge-across-copy.
Bryan O'Sullivan <bos@serpentine.com>
parents:
43
diff
changeset
|
477 \interaction{daily.copy.simple} |
380 | 478 $B%3%T!<@h$,%G%#%l%/%H%j$N>l9g!$(BMercurial$B$O%3%T!<85$r%3%T!<@h%G%#%l%/%H%j(B |
479 $B$NCf$K%3%T!<$9$k!%(B | |
117
6b0f4498569e
Beef up daily routine material. Focus on merge-across-copy.
Bryan O'Sullivan <bos@serpentine.com>
parents:
43
diff
changeset
|
480 \interaction{daily.copy.dir-dest} |
380 | 481 $B%G%#%l%/%H%j$N%3%T!<$O:F5"E*$G!$%3%T!<85$N%G%#%l%/%H%j9=B$$rJ]$D!%(B |
117
6b0f4498569e
Beef up daily routine material. Focus on merge-across-copy.
Bryan O'Sullivan <bos@serpentine.com>
parents:
43
diff
changeset
|
482 \interaction{daily.copy.dir-src} |
380 | 483 $B%3%T!<85$H%3%T!<@h$,6&$K%G%#%l%/%H%j$N>l9g!$%3%T!<85$N%D%j!<9=B$$,%3%T!<(B |
484 $B@h$N%G%#%l%/%H%j$NCf$K:F8=$5$l$k!%(B | |
117
6b0f4498569e
Beef up daily routine material. Focus on merge-across-copy.
Bryan O'Sullivan <bos@serpentine.com>
parents:
43
diff
changeset
|
485 \interaction{daily.copy.dir-src-dest} |
6b0f4498569e
Beef up daily routine material. Focus on merge-across-copy.
Bryan O'Sullivan <bos@serpentine.com>
parents:
43
diff
changeset
|
486 |
380 | 487 %As with the \hgcmd{rename} command, if you copy a file manually and |
488 %then want Mercurial to know that you've copied the file, simply use | |
489 %the \hgopt{copy}{--after} option to \hgcmd{copy}. | |
490 %\interaction{daily.copy.after} | |
491 | |
492 \hgcmd{rename}$B%3%^%s%I$HF1MM$K!$%U%!%$%k$r<jF0$G%3%T!<$7$?8e$G!$(BMercurial$B$K(B | |
493 $BA`:n$rDLCN$7$?$$>l9g$O!$(B\hgcmd{copy}$B%3%^%s%I$K(B\hgopt{copy}{--after}$B%*%W(B | |
494 $B%7%g%s$rIU$1$l$P$h$$!%(B | |
118
1ee53cb37a99
More progress on daily work.
Bryan O'Sullivan <bos@serpentine.com>
parents:
117
diff
changeset
|
495 \interaction{daily.copy.after} |
1ee53cb37a99
More progress on daily work.
Bryan O'Sullivan <bos@serpentine.com>
parents:
117
diff
changeset
|
496 |
368
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
497 %\section{Renaming files} |
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
498 \section{$B%U%!%$%k$N%j%M!<%`(B} |
43 | 499 |
380 | 500 %It's rather more common to need to rename a file than to make a copy |
501 %of it. The reason I discussed the \hgcmd{copy} command before talking | |
502 %about renaming files is that Mercurial treats a rename in essentially | |
503 %the same way as a copy. Therefore, knowing what Mercurial does when | |
504 %you copy a file tells you what to expect when you rename a file. | |
505 | |
506 $B%U%!%$%k$r%j%M!<%`$9$k$3$H$O%U%!%$%k$N%3%T!<$h$j$b$h$/9T$o$l$k!%%U%!%$%k(B | |
507 $B$N%j%M!<%`$h$j$bA0$K(B\hgcmd{copy}$B$K$D$$$F=R$Y$?M}M3$O!$(B Mercurial$B$,K\<AE*(B | |
508 $B$K%j%M!<%`$r%3%T!<$HF1MM$K07$&$+$i$G$"$k!%=>$C$F!$%U%!%$%k$r%3%T!<$9$k;~(B | |
509 $B$K(BMercurial$B$,9T$&$3$H$rCN$k$3$H$O!$%j%M!<%`$N:]$K5/$3$k$3$H$rCN$k$3$H$K$J(B | |
510 $B$k!%(B | |
43 | 511 |
380 | 512 %When you use the \hgcmd{rename} command, Mercurial makes a copy of |
513 %each source file, then deletes it and marks the file as removed. | |
514 %\interaction{daily.rename.rename} | |
515 %The \hgcmd{status} command shows the newly copied file as added, and | |
516 %the copied-from file as removed. | |
517 %\interaction{daily.rename.status} | |
518 | |
519 \hgcmd{rename}$B%3%^%s%I$r;H$&;~!$(BMercurial$B$O3F!9$N%=!<%9%U%!%$%k$r%3%T!<(B | |
520 $B$7!$85$N%U%!%$%k$r:o=|$7$F!$>C5n:Q$_$H%^!<%/$9$k!%(B | |
118
1ee53cb37a99
More progress on daily work.
Bryan O'Sullivan <bos@serpentine.com>
parents:
117
diff
changeset
|
521 \interaction{daily.rename.rename} |
380 | 522 \hgcmd{status}$B%3%^%s%I$O?7$?$K%3%T!<$5$l$?%U%!%$%k$rDI2C$5$l$?%U%!%$%k$H(B |
523 $B$7$FI=<($7!$%3%T!<$5$l$?%U%!%$%k$r>C5n$5$l$?%U%!%$%k$HI=<($9$k!%(B | |
118
1ee53cb37a99
More progress on daily work.
Bryan O'Sullivan <bos@serpentine.com>
parents:
117
diff
changeset
|
524 \interaction{daily.rename.status} |
380 | 525 |
526 %As with the results of a \hgcmd{copy}, we must use the | |
527 %\hgopt{status}{-C} option to \hgcmd{status} to see that the added file | |
528 %is really being tracked by Mercurial as a copy of the original, now | |
529 %removed, file. | |
530 %\interaction{daily.rename.status-copy} | |
531 | |
532 \hgcmd{copy}$B%3%^%s%I$N>l9g$HF1MM$K!$(B \hgcmd{status}$B%3%^%s%I$K(B | |
533 \hgopt{status}{-C}$B%*%W%7%g%s$rMQ$$$F!$DI2C$5$l$?%U%!%$%k$,>C5n$5$l$?%*%j(B | |
534 $B%8%J%k%U%!%$%k$N%3%T!<$H$7$F(BMercurial$B$KDI@W$5$l$F$$$k$N$+$rD4$Y$k$3$H$,$G(B | |
535 $B$-$k!%(B | |
118
1ee53cb37a99
More progress on daily work.
Bryan O'Sullivan <bos@serpentine.com>
parents:
117
diff
changeset
|
536 \interaction{daily.rename.status-copy} |
1ee53cb37a99
More progress on daily work.
Bryan O'Sullivan <bos@serpentine.com>
parents:
117
diff
changeset
|
537 |
380 | 538 %As with \hgcmd{remove} and \hgcmd{copy}, you can tell Mercurial about |
539 %a rename after the fact using the \hgopt{rename}{--after} option. In | |
540 %most other respects, the behaviour of the \hgcmd{rename} command, and | |
541 %the options it accepts, are similar to the \hgcmd{copy} command. | |
542 | |
543 \hgcmd{remove}$B$H(B\hgcmd{copy}$B$N$h$&$K!$(B\hgopt{rename}{--after}$B%*%W%7%g%s$r(B | |
544 $B;H$&$3$H$G!$;v8e$K%j%M!<%`$r$9$k$3$H$,$G$-$k!%B?$/$NE@$G(B\hgcmd{rename}$B%3(B | |
545 $B%^%s%I$N5sF0$H!$$3$N%3%^%s%I$,<u$1F~$l$k%*%W%7%g%s$O(B\hgcmd{copy}$B%3%^%s%I(B | |
546 $B$HN`;w$7$F$$$k!%(B | |
118
1ee53cb37a99
More progress on daily work.
Bryan O'Sullivan <bos@serpentine.com>
parents:
117
diff
changeset
|
547 |
368
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
548 %\subsection{Renaming files and merging changes} |
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
549 \subsection{$B%U%!%$%k$N%j%M!<%`$HJQ99$N%^!<%8(B} |
118
1ee53cb37a99
More progress on daily work.
Bryan O'Sullivan <bos@serpentine.com>
parents:
117
diff
changeset
|
550 |
376 | 551 %Since Mercurial's rename is implemented as copy-and-remove, the same |
552 %propagation of changes happens when you merge after a rename as after | |
553 %a copy. | |
554 | |
555 Mercurial$B$N%j%M!<%`$O%3%T!<$H:o=|$H$7$F<BAu$5$l$F$*$j!$%j%M!<%`8e$K%^!<(B | |
556 $B%8$r9T$&$N$H!$%3%T!<8e$K%^!<%8$r9T$&$N$G$OF1$8JQ99$NGH5Z$,5/$-$k!%(B | |
557 | |
558 %If I modify a file, and you rename it to a new name, and then we merge | |
559 %our respective changes, my modifications to the file under its | |
560 %original name will be propagated into the file under its new name. | |
561 %(This is something you might expect to ``simply work,'' but not all | |
562 %revision control systems actually do this.) | |
118
1ee53cb37a99
More progress on daily work.
Bryan O'Sullivan <bos@serpentine.com>
parents:
117
diff
changeset
|
563 |
376 | 564 $B;d$,%U%!%$%k$rJQ99$7!$$"$J$?$,$=$N%U%!%$%k$r$r?7$7$$L>A0$K%j%M!<%`$7$?>l(B |
565 $B9g!$2f!9$,$*8_$$$NJQ99$r%^!<%8$9$k$H85$N%U%!%$%kL>$KBP$9$k;d$NJQ99$O!$?7(B | |
566 $B$7$$%U%!%$%kL>$N%U%!%$%k$KGH5Z$9$k!%(B $B!J$3$l$,$G$-$k$N$OEv$?$jA0$H;W$&$+$b(B | |
567 $B$7$l$J$$$,!$<B$N$H$3$m!$A4$F$N%j%S%8%g%s%3%s%H%m!<%k%7%9%F%`$,$G$-$k$o$1(B | |
568 $B$G$O$J$$!%!K(B | |
43 | 569 |
376 | 570 %Whereas having changes follow a copy is a feature where you can |
571 %perhaps nod and say ``yes, that might be useful,'' it should be clear | |
572 %that having them follow a rename is definitely important. Without | |
573 %this facility, it would simply be too easy for changes to become | |
574 %orphaned when files are renamed. | |
575 | |
576 $BJQ99$,%3%T!<$K=>$&5!G=$,M-MQ$G$"$k$3$H$O!$$*$=$i$/MF0W$KF10U$,F@$i$l$k$H(B | |
577 $B$3$m$G$"$k$H;W$o$l$k!%$H$j$o$1%j%M!<%`$KDI=>$9$k5!G=$O$-$o$a$F=EMW$G$"$k(B | |
578 $B$3$H$OL@Gr$G$"$k!%$b$7$3$N5!G=$,$J$1$l$P!$%U%!%$%k$N%j%M!<%`$K$h$C$FJQ99(B | |
579 $B$OMF0W$/9T$->l$r<:$C$F$7$^$&$@$m$&!%(B | |
121
9094c9fda8ec
Start chapter on error recovery.
Bryan O'Sullivan <bos@serpentine.com>
parents:
118
diff
changeset
|
580 |
368
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
581 %\subsection{Divergent renames and merging} |
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
582 \subsection{$BL>A0$H%^!<%8$NH/;6(B} |
156
91a936be78b8
Document merge behaviour with file names.
Bryan O'Sullivan <bos@serpentine.com>
parents:
121
diff
changeset
|
583 |
376 | 584 %The case of diverging names occurs when two developers start with a |
585 %file---let's call it \filename{foo}---in their respective | |
586 %repositories. | |
587 | |
588 2$B?M$N3+H/<T$N%j%]%8%H%j4V$G(B1$B$D$N%U%!%$%k(B ---\filename{foo}$B$H8F$V$3$H$K$9(B | |
589 $B$k(B--- $B$K$D$$$FL>A0$NH/;6$,5/$3$C$?>l9g$K$D$$$F9M$($F$_$h$&!%(B | |
156
91a936be78b8
Document merge behaviour with file names.
Bryan O'Sullivan <bos@serpentine.com>
parents:
121
diff
changeset
|
590 |
91a936be78b8
Document merge behaviour with file names.
Bryan O'Sullivan <bos@serpentine.com>
parents:
121
diff
changeset
|
591 \interaction{rename.divergent.clone} |
376 | 592 %Anne renames the file to \filename{bar}. |
593 $B%"%s$O%U%!%$%k$r(B\filename{bar}$B$H2~L>$7$?!%(B | |
156
91a936be78b8
Document merge behaviour with file names.
Bryan O'Sullivan <bos@serpentine.com>
parents:
121
diff
changeset
|
594 \interaction{rename.divergent.rename.anne} |
376 | 595 %Meanwhile, Bob renames it to \filename{quux}. |
596 $B$=$N4V!$%\%V$OF1$8%U%!%$%k$r(B\filename{quux}$B$H2~L>$7$?!%(B | |
156
91a936be78b8
Document merge behaviour with file names.
Bryan O'Sullivan <bos@serpentine.com>
parents:
121
diff
changeset
|
597 \interaction{rename.divergent.rename.bob} |
91a936be78b8
Document merge behaviour with file names.
Bryan O'Sullivan <bos@serpentine.com>
parents:
121
diff
changeset
|
598 |
376 | 599 %I like to think of this as a conflict because each developer has |
600 %expressed different intentions about what the file ought to be named. | |
601 | |
602 $B3F!9$N3+H/<T$O%U%!%$%k$,$I$N$h$&$K8F$P$l$k$Y$-$+$K$D$$$F0[$J$C$?0U?^$r;}$C(B | |
603 $B$F$*$j!$$3$l$O%3%s%U%j%/%H$H9M$($i$l$k!%(B | |
156
91a936be78b8
Document merge behaviour with file names.
Bryan O'Sullivan <bos@serpentine.com>
parents:
121
diff
changeset
|
604 |
376 | 605 %What do you think should happen when they merge their work? |
606 %Mercurial's actual behaviour is that it always preserves \emph{both} | |
607 %names when it merges changesets that contain divergent renames. | |
608 %\interaction{rename.divergent.merge} | |
609 | |
610 $BH`$i$,%^!<%8$r9T$C$?:]$K$I$&$J$l$P$h$$$@$m$&$+!)(B Mercurial$B$N<B:]$N5sF0(B | |
611 $B$O!$H/;6$7$?%j%M!<%`$,$"$k%A%'%s%8%;%C%H$r%^!<%8$7$?>l9g$O>o$K(B\emph{$BN>J}(B}$B$N(B | |
612 $BL>A0$rJ]B8$9$k!%(B | |
156
91a936be78b8
Document merge behaviour with file names.
Bryan O'Sullivan <bos@serpentine.com>
parents:
121
diff
changeset
|
613 \interaction{rename.divergent.merge} |
91a936be78b8
Document merge behaviour with file names.
Bryan O'Sullivan <bos@serpentine.com>
parents:
121
diff
changeset
|
614 |
376 | 615 %Notice that Mercurial does warn about the divergent renames, but it |
616 %leaves it up to you to do something about the divergence after the merge. | |
617 | |
618 Mercurial$B$OL>A0$NH/;6$K$D$$$F7Y9p$9$k$,!$%^!<%88e$bL>A0$NH/;6$N2r7h$O%f!<(B | |
619 $B%6$KG$$;$kE@$KCm0U!%(B | |
156
91a936be78b8
Document merge behaviour with file names.
Bryan O'Sullivan <bos@serpentine.com>
parents:
121
diff
changeset
|
620 |
368
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
621 %\subsection{Convergent renames and merging} |
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
622 \subsection{$B%j%M!<%`$H%^!<%8$K$h$k<}B+(B} |
156
91a936be78b8
Document merge behaviour with file names.
Bryan O'Sullivan <bos@serpentine.com>
parents:
121
diff
changeset
|
623 |
376 | 624 %Another kind of rename conflict occurs when two people choose to |
625 %rename different \emph{source} files to the same \emph{destination}. | |
626 %In this case, Mercurial runs its normal merge machinery, and lets you | |
627 %guide it to a suitable resolution. | |
628 | |
629 2$B?M$N%f!<%6$,0[$J$k(B\emph{$B%=!<%9(B}$B%U%!%$%k72$rF10l$N(B\emph{$BL\E*(B}$B%U%!%$%k$K%j(B | |
630 $B%M!<%`$9$k$H>WFM$,5/$-$k!%$3$N>l9g!$(BMercurial$B$ODL>o$N%^!<%85!9=$r5/F0$7!$(B | |
631 $B%f!<%6$KE,@Z$J2r7h$rB%$9!%(B | |
156
91a936be78b8
Document merge behaviour with file names.
Bryan O'Sullivan <bos@serpentine.com>
parents:
121
diff
changeset
|
632 |
368
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
633 %\subsection{Other name-related corner cases} |
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
634 \subsection{$BL>A0$K4XO"$7$?$$$/$D$+$NLdBj(B} |
156
91a936be78b8
Document merge behaviour with file names.
Bryan O'Sullivan <bos@serpentine.com>
parents:
121
diff
changeset
|
635 |
376 | 636 %Mercurial has a longstanding bug in which it fails to handle a merge |
637 %where one side has a file with a given name, while another has a | |
638 %directory with the same name. This is documented as~\bug{29} . | |
639 %\interaction{issue29.go} | |
640 | |
641 Mercurial$B$K$O!$0lJ}$rL>A0$rM?$($?%U%!%$%k!$$b$&0lJ}$rF1L>$N%G%#%l%/%H%j$H(B | |
642 $B$7$F%^!<%8$r9T$&$H<:GT$9$k%P%0$,0JA0$+$i$"$k!%$3$l$O(B~\bug{29}$B$H$7$F%I%-%e(B | |
643 $B%a%s%H2=$5$l$F$$$k!%(B | |
156
91a936be78b8
Document merge behaviour with file names.
Bryan O'Sullivan <bos@serpentine.com>
parents:
121
diff
changeset
|
644 \interaction{issue29.go} |
121
9094c9fda8ec
Start chapter on error recovery.
Bryan O'Sullivan <bos@serpentine.com>
parents:
118
diff
changeset
|
645 |
368
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
646 %\section{Recovering from mistakes} |
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
647 \section{$B%_%9$+$i$N2sI|(B} |
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
648 |
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
649 %Mercurial has some useful commands that will help you to recover from |
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
650 %some common mistakes. |
180
6413f88338df
Point to chapter on undoing mistakes.
Bryan O'Sullivan <bos@serpentine.com>
parents:
178
diff
changeset
|
651 |
368
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
652 Mercurial$B$K$O0lHLE*$J%_%9$+$i$N2sI|$r=u$1$k$$$/$D$+$NM-MQ$J%3%^%s%I$,$"$k!%(B |
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
653 |
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
654 %The \hgcmd{revert} command lets you undo changes that you have made to |
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
655 %your working directory. For example, if you \hgcmd{add} a file by |
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
656 %accident, just run \hgcmd{revert} with the name of the file you added, |
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
657 %and while the file won't be touched in any way, it won't be tracked |
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
658 %for adding by Mercurial any longer, either. You can also use |
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
659 %\hgcmd{revert} to get rid of erroneous changes to a file. |
180
6413f88338df
Point to chapter on undoing mistakes.
Bryan O'Sullivan <bos@serpentine.com>
parents:
178
diff
changeset
|
660 |
368
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
661 \hgcmd{revert}$B%3%^%s%I$O%o!<%-%s%0%G%#%l%/%H%jFb$G9T$C$?JQ99$r<h$j>C$9!%(B |
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
662 $B$?$H$($P!$8m$C$F(B\hgcmd{add}$B$r9T$C$?>l9g!$DI2C$7$?%U%!%$%kL>$H6&$K(B |
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
663 \hgcmd{revert}$B$r<B9T$9$l$P%U%!%$%k$O2?$bJQ99$5$l$:!$(BMercurial$B$N4IM}$+$i30(B |
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
664 $B$5$l$k!%$^$?(B\hgcmd{revert}$B$O%U%!%$%k$X$N4V0c$C$?JQ99$r>C5n$9$k$N$b;H$($k!%(B |
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
665 |
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
666 %It's useful to remember that the \hgcmd{revert} command is useful for |
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
667 %changes that you have not yet committed. Once you've committed a |
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
668 %change, if you decide it was a mistake, you can still do something |
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
669 %about it, though your options may be more limited. |
180
6413f88338df
Point to chapter on undoing mistakes.
Bryan O'Sullivan <bos@serpentine.com>
parents:
178
diff
changeset
|
670 |
368
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
671 \hgcmd{revert}$B%3%^%s%I$OL$%3%_%C%H$NJQ99$KBP$7$FM-8z$G$"$k$3$H$r3P$($F$*(B |
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
672 $B$/$HNI$$!%JQ99$r%3%_%C%H$7$?$"$H$G!$$3$l$,4V0c$$$G$"$C$?$3$H$K5$$E$$$?>l(B |
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
673 $B9g$O!$$H$l$k<jCJ$O$d$d8B$i$l$k!%(B |
180
6413f88338df
Point to chapter on undoing mistakes.
Bryan O'Sullivan <bos@serpentine.com>
parents:
178
diff
changeset
|
674 |
368
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
675 %For more information about the \hgcmd{revert} command, and details |
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
676 %about how to deal with changes you have already committed, see |
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
677 %chapter~\ref{chap:undo}. |
180
6413f88338df
Point to chapter on undoing mistakes.
Bryan O'Sullivan <bos@serpentine.com>
parents:
178
diff
changeset
|
678 |
368
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
679 \hgcmd{revert}$B%3%^%s%I$K$D$$$F$N$h$j>\:Y$J>pJs$H!$$9$G$K%3%_%C%H$7$?JQ99(B |
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
680 $B$X$NA`:n$K$D$$$F$O(B~\ref{chap:undo}$B$N>O$r;2>H$5$l$?$$!%(B |
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
681 |
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
682 %%% Local Variables: |
293
3b1291f24c0d
- replaved latex-mode to yatex-mode
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
290
diff
changeset
|
683 %%% mode: yatex |
42
cbfa08bcf181
Start the "Mercurial in daily use" chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
684 %%% TeX-master: "00book" |
368
7ef84661e43e
started daily.tex either.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
348
diff
changeset
|
685 %%% End: |