comparison ja/cmdref.tex @ 294:b2d447356c42

- completed cmdref.tex - minor temporal changes.
author Yoshiki Yazawa <yaz@cc.rim.or.jp>
date Fri, 08 Feb 2008 01:41:42 +0900
parents f72e4be6dd37
children 32d33b238b7e
comparison
equal deleted inserted replaced
293:3b1291f24c0d 294:b2d447356c42
31 31
32 %Omit date and time information when printing diff headers. 32 %Omit date and time information when printing diff headers.
33 33
34 diff$B%X%C%@$+$iF|IU$H;~4V>pJs$r>JN,$9$k!%(B 34 diff$B%X%C%@$+$iF|IU$H;~4V>pJs$r>JN,$9$k!%(B
35 35
36 \optref{diff}{B}{ignore-blank-lines} 36 \optref{diff}{B}{$B6u9T$rL5;k$9$k(B}
37 37
38 %Do not print changes that only insert or delete blank lines. A line 38 %Do not print changes that only insert or delete blank lines. A line
39 %that contains only whitespace is not considered blank. 39 %that contains only whitespace is not considered blank.
40 40
41 $B6u9T$NA^F~$^$?$O:o=|$@$1$NJQ99$rI=<($7$J$$!%6uGrJ8;z$,4^$^$l$k9T$O6u9T$H(B 41 $B6u9T$NA^F~$^$?$O:o=|$@$1$NJQ99$rI=<($7$J$$!%6uGrJ8;z$,4^$^$l$k9T$O6u9T$H(B
204 204
205 \subsubsection{Why do the results of \hgcmd{diff} and \hgcmd{status} 205 \subsubsection{Why do the results of \hgcmd{diff} and \hgcmd{status}
206 differ?} 206 differ?}
207 \label{cmdref:diff-vs-status} 207 \label{cmdref:diff-vs-status}
208 208
209 When you run the \hgcmd{status} command, you'll see a list of files 209 %When you run the \hgcmd{status} command, you'll see a list of files
210 that Mercurial will record changes for the next time you perform a 210 %that Mercurial will record changes for the next time you perform a
211 commit. If you run the \hgcmd{diff} command, you may notice that it 211 %commit. If you run the \hgcmd{diff} command, you may notice that it
212 prints diffs for only a \emph{subset} of the files that \hgcmd{status} 212 %prints diffs for only a \emph{subset} of the files that \hgcmd{status}
213 listed. There are two possible reasons for this. 213 %listed. There are two possible reasons for this.
214 214
215 The first is that \hgcmd{status} prints some kinds of modifications 215 \hgcmd{status}$B$r<B9T$7$?;~!$(BMercurial$B$O<!2s$N%3%_%C%H$G5-O?$9$kJQ99$N%j(B
216 that \hgcmd{diff} doesn't normally display. The \hgcmd{diff} command 216 $B%9%H$rI=<($9$k!%(B\hgcmd{diff}$B$r<B9T$9$k$H!$(B\hgcmd{status}$B$N(B\emph{$B0lIt(B
217 normally outputs unified diffs, which don't have the ability to 217 $B$N(B}diff$B$,I=<($5$l$k$3$H$K5$IU$/$@$m$&!%$3$l$K$OFs$D$NM}M3$,9M$($i$l$k!%(B
218 represent some changes that Mercurial can track. Most notably, 218
219 traditional diffs can't represent a change in whether or not a file is 219 %The first is that \hgcmd{status} prints some kinds of modifications
220 executable, but Mercurial records this information. 220 %that \hgcmd{diff} doesn't normally display. The \hgcmd{diff} command
221 221 %normally outputs unified diffs, which don't have the ability to
222 If you use the \hgopt{diff}{--git} option to \hgcmd{diff}, it will 222 %represent some changes that Mercurial can track. Most notably,
223 display \command{git}-compatible diffs that \emph{can} display this 223 %traditional diffs can't represent a change in whether or not a file is
224 extra information. 224 %executable, but Mercurial records this information.
225 225
226 The second possible reason that \hgcmd{diff} might be printing diffs 226 1$B$DL\$O(B\hgcmd{status}$B$,(B\hgcmd{diff}$B$,DL>oI=<($7$J$$2?<oN`$+$NJQ99$rI=<($9(B
227 for a subset of the files displayed by \hgcmd{status} is that if you 227 $B$k$?$a$G$"$k!%(B\hgcmd{diff}$B$ODL>o(Bunified diff$B7A<0$G=PNO$9$k$,!$$3$l$O(B
228 invoke it without any arguments, \hgcmd{diff} prints diffs against the 228 Mercurial$B$,DI@W$G$-$kJQ99$N$$$/$D$+$rDI@W$G$-$J$$!%FC$K!$8E$$(Bdiff$B$G$O%U%!(B
229 first parent of the working directory. If you have run \hgcmd{merge} 229 $B%$%k$,<B9T$+$N$&$+$I$&$+$rI=8=$G$-$J$$$,!$(BMercurial$B$O$3$N>pJs$r5-O?$9$k!%(B
230 to merge two changesets, but you haven't yet committed the results of 230
231 the merge, your working directory has two parents (use \hgcmd{parents} 231 %If you use the \hgopt{diff}{--git} option to \hgcmd{diff}, it will
232 to see them). While \hgcmd{status} prints modifications relative to 232 %display \command{git}-compatible diffs that \emph{can} display this
233 \emph{both} parents after an uncommitted merge, \hgcmd{diff} still 233 %extra information.
234 operates relative only to the first parent. You can get it to print 234
235 diffs relative to the second parent by specifying that parent with the 235 \hgcmd{diff}$B%3%^%s%I$G(B\hgopt{diff}{--git}$B%*%W%7%g%s$r;H$C$F$$$k>l9g!$(B
236 \hgopt{diff}{-r} option. There is no way to print diffs relative to 236 $B$3$N>pJs$rI=<($G$-$k(B\command{git}$B8_49$N(Bdiff$B$r=PNO$9$k!%(B
237 both parents. 237
238 238 %The second possible reason that \hgcmd{diff} might be printing diffs
239 \subsubsection{Generating safe binary diffs} 239 %for a subset of the files displayed by \hgcmd{status} is that if you
240 240 %invoke it without any arguments, \hgcmd{diff} prints diffs against the
241 If you use the \hgopt{diff}{-a} option to force Mercurial to print 241 %first parent of the working directory.If you have run \hgcmd{merge}
242 diffs of files that are either ``mostly text'' or contain lots of 242 %to merge two changesets, but you haven't yet committed the results of
243 binary data, those diffs cannot subsequently be applied by either 243 %the merge,your working directory has two parents (use \hgcmd{parents}
244 Mercurial's \hgcmd{import} command or the system's \command{patch} 244 %to see them).While \hgcmd{status} prints modifications relative to
245 command. 245 %\emph{both} parents after an uncommitted merge, \hgcmd{diff} still
246 246 %operates relative only to the first parent. You can get it to print
247 If you want to generate a diff of a binary file that is safe to use as 247 %diffs relative to the second parent by specifying that parent with the
248 input for \hgcmd{import}, use the \hgcmd{diff}{--git} option when you 248 %\hgopt{diff}{-r} option. There is no way to print diffs relative to
249 generate the patch. The system \command{patch} command cannot handle 249 %both parents.
250 binary patches at all. 250
251 2$B$DL\$N9M$($i$l$kM}M3$O!$(B\hgcmd{diff}$B$r0z?t$J$7$G8F$s$G$$$k$?$a!$(B
252 \hgcmd{diff}$B$,%o!<%-%s%0%G%#%l%/%H%j$ND>@\$N?F$H$N:9J,$r<h$C$F$$$k$?$a$G(B
253 $B$"$k!%%A%'%s%8%;%C%H$r%^!<%8$9$k$?$a$K(B\hgcmd{merge}$B$r<B9T$9$k$H!$%o!<%-%s(B
254 $B%0%G%#%l%/%H%j$O(B2$B$D$N?F$r;}$D$3$H$K$J$k!%!J?F$rI=<($9$k$K$O(B
255 \hgcmd{parents}$B$r;H$&!%!K(B\hgcmd{status}$B$O%3%_%C%H$5$l$F$$$J$$%^!<%8$N(B
256 \emph{$BN>J}(B}$B$N?F$H$N:9J,$r<h$k$N$KBP$7$F!$(B\hgcmd{diff}$B$O=g=xE*$K@h$N?F$H(B
257 $B$N:9J,$r<h$k!%8e$N?F$H$N:9J,$r<h$k$?$a$K$O(B\hgopt{diff}{-r}$B%*%W%7%g%s$r;H(B
258 $B$&!%N>J}$N?F$H$N:9J,$r<h$kJ}K!$OB8:_$7$J$$!%(B
259
260
261 %\subsubsection{Generating safe binary diffs}
262 \subsubsection{$B%P%$%J%j$N:9J,$r0BA4$K<hF@$9$k(B}
263
264 %If you use the \hgopt{diff}{-a} option to force Mercurial to print
265 %diffs of files that are either ``mostly text'' or contain lots of
266 %binary data, those diffs cannot subsequently be applied by either
267 %Mercurial's \hgcmd{import} command or the system's \command{patch}
268 %command.
269
270 $BBgH>$,%F%-%9%H$G$"$k%U%!%$%kF1;N$d!$B?$/$N%P%$%J%j%G!<%?$,4^$^$l$k%U%!%$(B
271 $B%kF1;N$N:9J,$r<h$k$?$a$K(B\hopt{diff}{-a}$B$r;XDj$9$k>l9g!$@8@.$5$l$?:9J,$O(B
272 Mercurial$B$N(B\hgcmd{import}$B%3%^%s%I$d%7%9%F%`$N(B\command{patch}$B$KMQ$$$k$3$H(B
273 $B$,$G$-$J$$!%(B
274
275 %If you want to generate a diff of a binary file that is safe to use as
276 %input for \hgcmd{import}, use the \hgcmd{diff}{--git} option when you
277 %generate the patch. The system \command{patch} command cannot handle
278 %binary patches at all.
279
280 \hgcmd{import}$B$GMxMQ$G$-$k%P%$%J%j%U%!%$%k$N:9J,$r@8@.$9$k$K$O!$(B
281 $B%Q%C%A@8@.$K(B\hgcmd{diff}{--git}$B%*%W%7%g%s$r;XDj$9$l$P$h$$!%%7%9%F%`$N(B
282 \command{patch}$B%3%^%s%I$+$i$O$3$N:9J,$OMxMQ$G$-$J$$!%(B
251 283
252 %%% Local Variables: 284 %%% Local Variables:
253 %%% mode: yatex 285 %%% mode: yatex
254 %%% TeX-master: "00book" 286 %%% TeX-master: "00book"
255 %%% End: 287 %%% End: