Mercurial > hgbook
annotate es/cmdref.tex @ 533:c847605eb2a9
translated a bit, will stop translating this file until I figure out how to translate the expression "case sensitivity"
author | jerojasro@localhost |
---|---|
date | Mon, 01 Dec 2008 20:56:29 -0500 |
parents | b05e35d641e4 |
children | 1b8b19825994 |
rev | line source |
---|---|
501
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
1 \chapter{Command reference} |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
2 \label{cmdref} |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
3 |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
4 \cmdref{add}{add files at the next commit} |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
5 \optref{add}{I}{include} |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
6 \optref{add}{X}{exclude} |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
7 \optref{add}{n}{dry-run} |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
8 |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
9 \cmdref{diff}{print changes in history or working directory} |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
10 |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
11 Show differences between revisions for the specified files or |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
12 directories, using the unified diff format. For a description of the |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
13 unified diff format, see section~\ref{sec:mq:patch}. |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
14 |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
15 By default, this command does not print diffs for files that Mercurial |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
16 considers to contain binary data. To control this behaviour, see the |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
17 \hgopt{diff}{-a} and \hgopt{diff}{--git} options. |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
18 |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
19 \subsection{Options} |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
20 |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
21 \loptref{diff}{nodates} |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
22 |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
23 Omit date and time information when printing diff headers. |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
24 |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
25 \optref{diff}{B}{ignore-blank-lines} |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
26 |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
27 Do not print changes that only insert or delete blank lines. A line |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
28 that contains only whitespace is not considered blank. |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
29 |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
30 \optref{diff}{I}{include} |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
31 |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
32 Include files and directories whose names match the given patterns. |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
33 |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
34 \optref{diff}{X}{exclude} |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
35 |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
36 Exclude files and directories whose names match the given patterns. |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
37 |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
38 \optref{diff}{a}{text} |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
39 |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
40 If this option is not specified, \hgcmd{diff} will refuse to print |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
41 diffs for files that it detects as binary. Specifying \hgopt{diff}{-a} |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
42 forces \hgcmd{diff} to treat all files as text, and generate diffs for |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
43 all of them. |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
44 |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
45 This option is useful for files that are ``mostly text'' but have a |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
46 few embedded NUL characters. If you use it on files that contain a |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
47 lot of binary data, its output will be incomprehensible. |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
48 |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
49 \optref{diff}{b}{ignore-space-change} |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
50 |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
51 Do not print a line if the only change to that line is in the amount |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
52 of white space it contains. |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
53 |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
54 \optref{diff}{g}{git} |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
55 |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
56 Print \command{git}-compatible diffs. XXX reference a format |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
57 description. |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
58 |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
59 \optref{diff}{p}{show-function} |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
60 |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
61 Display the name of the enclosing function in a hunk header, using a |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
62 simple heuristic. This functionality is enabled by default, so the |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
63 \hgopt{diff}{-p} option has no effect unless you change the value of |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
64 the \rcitem{diff}{showfunc} config item, as in the following example. |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
65 \interaction{cmdref.diff-p} |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
66 |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
67 \optref{diff}{r}{rev} |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
68 |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
69 Specify one or more revisions to compare. The \hgcmd{diff} command |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
70 accepts up to two \hgopt{diff}{-r} options to specify the revisions to |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
71 compare. |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
72 |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
73 \begin{enumerate} |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
74 \setcounter{enumi}{0} |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
75 \item Display the differences between the parent revision of the |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
76 working directory and the working directory. |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
77 \item Display the differences between the specified changeset and the |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
78 working directory. |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
79 \item Display the differences between the two specified changesets. |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
80 \end{enumerate} |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
81 |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
82 You can specify two revisions using either two \hgopt{diff}{-r} |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
83 options or revision range notation. For example, the two revision |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
84 specifications below are equivalent. |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
85 \begin{codesample2} |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
86 hg diff -r 10 -r 20 |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
87 hg diff -r10:20 |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
88 \end{codesample2} |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
89 |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
90 When you provide two revisions, Mercurial treats the order of those |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
91 revisions as significant. Thus, \hgcmdargs{diff}{-r10:20} will |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
92 produce a diff that will transform files from their contents as of |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
93 revision~10 to their contents as of revision~20, while |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
94 \hgcmdargs{diff}{-r20:10} means the opposite: the diff that will |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
95 transform files from their revision~20 contents to their revision~10 |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
96 contents. You cannot reverse the ordering in this way if you are |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
97 diffing against the working directory. |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
98 |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
99 \optref{diff}{w}{ignore-all-space} |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
100 |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
101 \cmdref{version}{print version and copyright information} |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
102 |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
103 This command displays the version of Mercurial you are running, and |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
104 its copyright license. There are four kinds of version string that |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
105 you may see. |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
106 \begin{itemize} |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
107 \item The string ``\texttt{unknown}''. This version of Mercurial was |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
108 not built in a Mercurial repository, and cannot determine its own |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
109 version. |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
110 \item A short numeric string, such as ``\texttt{1.1}''. This is a |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
111 build of a revision of Mercurial that was identified by a specific |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
112 tag in the repository where it was built. (This doesn't necessarily |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
113 mean that you're running an official release; someone else could |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
114 have added that tag to any revision in the repository where they |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
115 built Mercurial.) |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
116 \item A hexadecimal string, such as ``\texttt{875489e31abe}''. This |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
117 is a build of the given revision of Mercurial. |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
118 \item A hexadecimal string followed by a date, such as |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
119 ``\texttt{875489e31abe+20070205}''. This is a build of the given |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
120 revision of Mercurial, where the build repository contained some |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
121 local changes that had not been committed. |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
122 \end{itemize} |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
123 |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
124 \subsection{Tips and tricks} |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
125 |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
126 \subsubsection{Why do the results of \hgcmd{diff} and \hgcmd{status} |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
127 differ?} |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
128 \label{cmdref:diff-vs-status} |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
129 |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
130 When you run the \hgcmd{status} command, you'll see a list of files |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
131 that Mercurial will record changes for the next time you perform a |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
132 commit. If you run the \hgcmd{diff} command, you may notice that it |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
133 prints diffs for only a \emph{subset} of the files that \hgcmd{status} |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
134 listed. There are two possible reasons for this. |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
135 |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
136 The first is that \hgcmd{status} prints some kinds of modifications |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
137 that \hgcmd{diff} doesn't normally display. The \hgcmd{diff} command |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
138 normally outputs unified diffs, which don't have the ability to |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
139 represent some changes that Mercurial can track. Most notably, |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
140 traditional diffs can't represent a change in whether or not a file is |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
141 executable, but Mercurial records this information. |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
142 |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
143 If you use the \hgopt{diff}{--git} option to \hgcmd{diff}, it will |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
144 display \command{git}-compatible diffs that \emph{can} display this |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
145 extra information. |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
146 |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
147 The second possible reason that \hgcmd{diff} might be printing diffs |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
148 for a subset of the files displayed by \hgcmd{status} is that if you |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
149 invoke it without any arguments, \hgcmd{diff} prints diffs against the |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
150 first parent of the working directory. If you have run \hgcmd{merge} |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
151 to merge two changesets, but you haven't yet committed the results of |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
152 the merge, your working directory has two parents (use \hgcmd{parents} |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
153 to see them). While \hgcmd{status} prints modifications relative to |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
154 \emph{both} parents after an uncommitted merge, \hgcmd{diff} still |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
155 operates relative only to the first parent. You can get it to print |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
156 diffs relative to the second parent by specifying that parent with the |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
157 \hgopt{diff}{-r} option. There is no way to print diffs relative to |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
158 both parents. |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
159 |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
160 \subsubsection{Generating safe binary diffs} |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
161 |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
162 If you use the \hgopt{diff}{-a} option to force Mercurial to print |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
163 diffs of files that are either ``mostly text'' or contain lots of |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
164 binary data, those diffs cannot subsequently be applied by either |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
165 Mercurial's \hgcmd{import} command or the system's \command{patch} |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
166 command. |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
167 |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
168 If you want to generate a diff of a binary file that is safe to use as |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
169 input for \hgcmd{import}, use the \hgcmd{diff}{--git} option when you |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
170 generate the patch. The system \command{patch} command cannot handle |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
171 binary patches at all. |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
172 |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
173 %%% Local Variables: |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
174 %%% mode: latex |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
175 %%% TeX-master: "00book" |
b05e35d641e4
Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents:
432
diff
changeset
|
176 %%% End: |