Mercurial > hgbook
annotate en/appA-cmdref.xml @ 690:b788b405e141
Replace uses of <informalfigure> with <figure>
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Thu, 26 Mar 2009 21:07:39 -0700 |
parents | c838b3975bc6 |
children | 4ce9d0754af3 |
rev | line source |
---|---|
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
1 <!-- vim: set filetype=docbkxml shiftwidth=2 autoindent expandtab tw=77 : --> |
132
e1e2f3e0256a
Start command reference, with the diff command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
2 |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
3 <appendix id="cmdref"> |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
4 <title>Command reference</title> |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
5 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
6 <para id="x_653">\cmdref{add}{add files at the next commit} |
133
1e013fbe35f7
Lots of filename related content. A little more command reference
Bryan O'Sullivan <bos@serpentine.com>
parents:
132
diff
changeset
|
7 \optref{add}{I}{include} |
1e013fbe35f7
Lots of filename related content. A little more command reference
Bryan O'Sullivan <bos@serpentine.com>
parents:
132
diff
changeset
|
8 \optref{add}{X}{exclude} |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
9 \optref{add}{n}{dry-run}</para> |
133
1e013fbe35f7
Lots of filename related content. A little more command reference
Bryan O'Sullivan <bos@serpentine.com>
parents:
132
diff
changeset
|
10 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
11 <para id="x_654">\cmdref{diff}{print changes in history or working directory}</para> |
132
e1e2f3e0256a
Start command reference, with the diff command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
12 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
13 <para id="x_655">Show differences between revisions for the specified files or |
132
e1e2f3e0256a
Start command reference, with the diff command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
14 directories, using the unified diff format. For a description of the |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
15 unified diff format, see section <xref linkend="sec:mq:patch"/>.</para> |
132
e1e2f3e0256a
Start command reference, with the diff command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
16 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
17 <para id="x_656">By default, this command does not print diffs for files that Mercurial |
133
1e013fbe35f7
Lots of filename related content. A little more command reference
Bryan O'Sullivan <bos@serpentine.com>
parents:
132
diff
changeset
|
18 considers to contain binary data. To control this behaviour, see the |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
19 <option role="hg-opt-diff">-a</option> and <option role="hg-opt-diff">--git</option> options.</para> |
133
1e013fbe35f7
Lots of filename related content. A little more command reference
Bryan O'Sullivan <bos@serpentine.com>
parents:
132
diff
changeset
|
20 |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
21 <sect2> |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
22 <title>Options</title> |
133
1e013fbe35f7
Lots of filename related content. A little more command reference
Bryan O'Sullivan <bos@serpentine.com>
parents:
132
diff
changeset
|
23 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
24 <para id="x_657">\loptref{diff}{nodates}</para> |
133
1e013fbe35f7
Lots of filename related content. A little more command reference
Bryan O'Sullivan <bos@serpentine.com>
parents:
132
diff
changeset
|
25 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
26 <para id="x_658">Omit date and time information when printing diff headers.</para> |
133
1e013fbe35f7
Lots of filename related content. A little more command reference
Bryan O'Sullivan <bos@serpentine.com>
parents:
132
diff
changeset
|
27 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
28 <para id="x_659">\optref{diff}{B}{ignore-blank-lines}</para> |
132
e1e2f3e0256a
Start command reference, with the diff command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
29 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
30 <para id="x_65a">Do not print changes that only insert or delete blank lines. A line |
133
1e013fbe35f7
Lots of filename related content. A little more command reference
Bryan O'Sullivan <bos@serpentine.com>
parents:
132
diff
changeset
|
31 that contains only whitespace is not considered blank. |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
32 </para> |
133
1e013fbe35f7
Lots of filename related content. A little more command reference
Bryan O'Sullivan <bos@serpentine.com>
parents:
132
diff
changeset
|
33 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
34 <para id="x_65b">\optref{diff}{I}{include} |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
35 </para> |
132
e1e2f3e0256a
Start command reference, with the diff command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
36 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
37 <para id="x_65c">Include files and directories whose names match the given patterns. |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
38 </para> |
133
1e013fbe35f7
Lots of filename related content. A little more command reference
Bryan O'Sullivan <bos@serpentine.com>
parents:
132
diff
changeset
|
39 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
40 <para id="x_65d">\optref{diff}{X}{exclude} |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
41 </para> |
133
1e013fbe35f7
Lots of filename related content. A little more command reference
Bryan O'Sullivan <bos@serpentine.com>
parents:
132
diff
changeset
|
42 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
43 <para id="x_65e">Exclude files and directories whose names match the given patterns. |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
44 </para> |
133
1e013fbe35f7
Lots of filename related content. A little more command reference
Bryan O'Sullivan <bos@serpentine.com>
parents:
132
diff
changeset
|
45 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
46 <para id="x_65f">\optref{diff}{a}{text} |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
47 </para> |
132
e1e2f3e0256a
Start command reference, with the diff command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
48 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
49 <para id="x_660">If this option is not specified, <command role="hg-cmd">hg diff</command> will refuse to print |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
50 diffs for files that it detects as binary. Specifying <option role="hg-opt-diff">-a</option> |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
51 forces <command role="hg-cmd">hg diff</command> to treat all files as text, and generate diffs for |
132
e1e2f3e0256a
Start command reference, with the diff command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
52 all of them. |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
53 </para> |
132
e1e2f3e0256a
Start command reference, with the diff command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
54 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
55 <para id="x_661">This option is useful for files that are <quote>mostly text</quote> but have a |
133
1e013fbe35f7
Lots of filename related content. A little more command reference
Bryan O'Sullivan <bos@serpentine.com>
parents:
132
diff
changeset
|
56 few embedded NUL characters. If you use it on files that contain a |
1e013fbe35f7
Lots of filename related content. A little more command reference
Bryan O'Sullivan <bos@serpentine.com>
parents:
132
diff
changeset
|
57 lot of binary data, its output will be incomprehensible. |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
58 </para> |
133
1e013fbe35f7
Lots of filename related content. A little more command reference
Bryan O'Sullivan <bos@serpentine.com>
parents:
132
diff
changeset
|
59 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
60 <para id="x_662">\optref{diff}{b}{ignore-space-change} |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
61 </para> |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
62 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
63 <para id="x_663">Do not print a line if the only change to that line is in the amount |
133
1e013fbe35f7
Lots of filename related content. A little more command reference
Bryan O'Sullivan <bos@serpentine.com>
parents:
132
diff
changeset
|
64 of white space it contains. |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
65 </para> |
133
1e013fbe35f7
Lots of filename related content. A little more command reference
Bryan O'Sullivan <bos@serpentine.com>
parents:
132
diff
changeset
|
66 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
67 <para id="x_664">\optref{diff}{g}{git} |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
68 </para> |
133
1e013fbe35f7
Lots of filename related content. A little more command reference
Bryan O'Sullivan <bos@serpentine.com>
parents:
132
diff
changeset
|
69 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
70 <para id="x_665">Print <command>git</command>-compatible diffs. XXX reference a format |
133
1e013fbe35f7
Lots of filename related content. A little more command reference
Bryan O'Sullivan <bos@serpentine.com>
parents:
132
diff
changeset
|
71 description. |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
72 </para> |
132
e1e2f3e0256a
Start command reference, with the diff command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
73 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
74 <para id="x_666">\optref{diff}{p}{show-function} |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
75 </para> |
132
e1e2f3e0256a
Start command reference, with the diff command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
76 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
77 <para id="x_667">Display the name of the enclosing function in a hunk header, using a |
133
1e013fbe35f7
Lots of filename related content. A little more command reference
Bryan O'Sullivan <bos@serpentine.com>
parents:
132
diff
changeset
|
78 simple heuristic. This functionality is enabled by default, so the |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
79 <option role="hg-opt-diff">-p</option> option has no effect unless you change the value of |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
80 the <envar role="rc-item-diff">showfunc</envar> config item, as in the following example.</para> |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
81 |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
82 <!-- &interaction.cmdref.diff-p; --> |
133
1e013fbe35f7
Lots of filename related content. A little more command reference
Bryan O'Sullivan <bos@serpentine.com>
parents:
132
diff
changeset
|
83 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
84 <para id="x_668">\optref{diff}{r}{rev} |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
85 </para> |
133
1e013fbe35f7
Lots of filename related content. A little more command reference
Bryan O'Sullivan <bos@serpentine.com>
parents:
132
diff
changeset
|
86 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
87 <para id="x_669">Specify one or more revisions to compare. The <command role="hg-cmd">hg diff</command> command |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
88 accepts up to two <option role="hg-opt-diff">-r</option> options to specify the revisions to |
133
1e013fbe35f7
Lots of filename related content. A little more command reference
Bryan O'Sullivan <bos@serpentine.com>
parents:
132
diff
changeset
|
89 compare. |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
90 </para> |
132
e1e2f3e0256a
Start command reference, with the diff command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
91 |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
92 <orderedlist> |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
93 <listitem><para id="x_66a">Display the differences between the parent revision of the |
133
1e013fbe35f7
Lots of filename related content. A little more command reference
Bryan O'Sullivan <bos@serpentine.com>
parents:
132
diff
changeset
|
94 working directory and the working directory. |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
95 </para> |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
96 </listitem> |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
97 <listitem><para id="x_66b">Display the differences between the specified changeset and the |
132
e1e2f3e0256a
Start command reference, with the diff command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
98 working directory. |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
99 </para> |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
100 </listitem> |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
101 <listitem><para id="x_66c">Display the differences between the two specified changesets. |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
102 </para> |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
103 </listitem></orderedlist> |
132
e1e2f3e0256a
Start command reference, with the diff command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
104 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
105 <para id="x_66d">You can specify two revisions using either two <option role="hg-opt-diff">-r</option> |
132
e1e2f3e0256a
Start command reference, with the diff command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
106 options or revision range notation. For example, the two revision |
e1e2f3e0256a
Start command reference, with the diff command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
107 specifications below are equivalent. |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
108 </para> |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
109 <programlisting>hg diff -r 10 -r 20 |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
110 hg diff -r10:20</programlisting> |
132
e1e2f3e0256a
Start command reference, with the diff command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
111 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
112 <para id="x_66e">When you provide two revisions, Mercurial treats the order of those |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
113 revisions as significant. Thus, <command role="hg-cmd">hg diff -r10:20</command> will |
132
e1e2f3e0256a
Start command reference, with the diff command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
114 produce a diff that will transform files from their contents as of |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
115 revision 10 to their contents as of revision 20, while |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
116 <command role="hg-cmd">hg diff -r20:10</command> means the opposite: the diff that will |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
117 transform files from their revision 20 contents to their revision 10 |
132
e1e2f3e0256a
Start command reference, with the diff command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
118 contents. You cannot reverse the ordering in this way if you are |
e1e2f3e0256a
Start command reference, with the diff command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
119 diffing against the working directory. |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
120 </para> |
132
e1e2f3e0256a
Start command reference, with the diff command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
121 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
122 <para id="x_66f">\optref{diff}{w}{ignore-all-space} |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
123 </para> |
133
1e013fbe35f7
Lots of filename related content. A little more command reference
Bryan O'Sullivan <bos@serpentine.com>
parents:
132
diff
changeset
|
124 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
125 <para id="x_670">\cmdref{version}{print version and copyright information} |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
126 </para> |
133
1e013fbe35f7
Lots of filename related content. A little more command reference
Bryan O'Sullivan <bos@serpentine.com>
parents:
132
diff
changeset
|
127 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
128 <para id="x_671">This command displays the version of Mercurial you are running, and |
133
1e013fbe35f7
Lots of filename related content. A little more command reference
Bryan O'Sullivan <bos@serpentine.com>
parents:
132
diff
changeset
|
129 its copyright license. There are four kinds of version string that |
1e013fbe35f7
Lots of filename related content. A little more command reference
Bryan O'Sullivan <bos@serpentine.com>
parents:
132
diff
changeset
|
130 you may see. |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
131 </para> |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
132 <itemizedlist> |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
133 <listitem><para id="x_672">The string <quote><literal>unknown</literal></quote>. This version of Mercurial was |
133
1e013fbe35f7
Lots of filename related content. A little more command reference
Bryan O'Sullivan <bos@serpentine.com>
parents:
132
diff
changeset
|
134 not built in a Mercurial repository, and cannot determine its own |
1e013fbe35f7
Lots of filename related content. A little more command reference
Bryan O'Sullivan <bos@serpentine.com>
parents:
132
diff
changeset
|
135 version. |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
136 </para> |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
137 </listitem> |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
138 <listitem><para id="x_673">A short numeric string, such as <quote><literal>1.1</literal></quote>. This is a |
133
1e013fbe35f7
Lots of filename related content. A little more command reference
Bryan O'Sullivan <bos@serpentine.com>
parents:
132
diff
changeset
|
139 build of a revision of Mercurial that was identified by a specific |
1e013fbe35f7
Lots of filename related content. A little more command reference
Bryan O'Sullivan <bos@serpentine.com>
parents:
132
diff
changeset
|
140 tag in the repository where it was built. (This doesn't necessarily |
1e013fbe35f7
Lots of filename related content. A little more command reference
Bryan O'Sullivan <bos@serpentine.com>
parents:
132
diff
changeset
|
141 mean that you're running an official release; someone else could |
1e013fbe35f7
Lots of filename related content. A little more command reference
Bryan O'Sullivan <bos@serpentine.com>
parents:
132
diff
changeset
|
142 have added that tag to any revision in the repository where they |
1e013fbe35f7
Lots of filename related content. A little more command reference
Bryan O'Sullivan <bos@serpentine.com>
parents:
132
diff
changeset
|
143 built Mercurial.) |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
144 </para> |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
145 </listitem> |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
146 <listitem><para id="x_674">A hexadecimal string, such as <quote><literal>875489e31abe</literal></quote>. This |
133
1e013fbe35f7
Lots of filename related content. A little more command reference
Bryan O'Sullivan <bos@serpentine.com>
parents:
132
diff
changeset
|
147 is a build of the given revision of Mercurial. |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
148 </para> |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
149 </listitem> |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
150 <listitem><para id="x_675">A hexadecimal string followed by a date, such as |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
151 <quote><literal>875489e31abe+20070205</literal></quote>. This is a build of the given |
133
1e013fbe35f7
Lots of filename related content. A little more command reference
Bryan O'Sullivan <bos@serpentine.com>
parents:
132
diff
changeset
|
152 revision of Mercurial, where the build repository contained some |
1e013fbe35f7
Lots of filename related content. A little more command reference
Bryan O'Sullivan <bos@serpentine.com>
parents:
132
diff
changeset
|
153 local changes that had not been committed. |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
154 </para> |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
155 </listitem></itemizedlist> |
133
1e013fbe35f7
Lots of filename related content. A little more command reference
Bryan O'Sullivan <bos@serpentine.com>
parents:
132
diff
changeset
|
156 |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
157 </sect2> |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
158 <sect2> |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
159 <title>Tips and tricks</title> |
133
1e013fbe35f7
Lots of filename related content. A little more command reference
Bryan O'Sullivan <bos@serpentine.com>
parents:
132
diff
changeset
|
160 |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
161 <sect3 id="cmdref:diff-vs-status"> |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
162 <title>Why do the results of <command role="hg-cmd">hg diff</command> and <command role="hg-cmd">hg status</command> differ?</title> |
132
e1e2f3e0256a
Start command reference, with the diff command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
163 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
164 <para id="x_676">When you run the <command role="hg-cmd">hg status</command> command, you'll see a list of files |
132
e1e2f3e0256a
Start command reference, with the diff command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
165 that Mercurial will record changes for the next time you perform a |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
166 commit. If you run the <command role="hg-cmd">hg diff</command> command, you may notice that it |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
167 prints diffs for only a <emphasis>subset</emphasis> of the files that <command role="hg-cmd">hg status</command> |
132
e1e2f3e0256a
Start command reference, with the diff command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
168 listed. There are two possible reasons for this. |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
169 </para> |
132
e1e2f3e0256a
Start command reference, with the diff command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
170 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
171 <para id="x_677">The first is that <command role="hg-cmd">hg status</command> prints some kinds of modifications |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
172 that <command role="hg-cmd">hg diff</command> doesn't normally display. The <command role="hg-cmd">hg diff</command> command |
132
e1e2f3e0256a
Start command reference, with the diff command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
173 normally outputs unified diffs, which don't have the ability to |
e1e2f3e0256a
Start command reference, with the diff command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
174 represent some changes that Mercurial can track. Most notably, |
e1e2f3e0256a
Start command reference, with the diff command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
175 traditional diffs can't represent a change in whether or not a file is |
e1e2f3e0256a
Start command reference, with the diff command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
176 executable, but Mercurial records this information. |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
177 </para> |
132
e1e2f3e0256a
Start command reference, with the diff command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
178 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
179 <para id="x_678">If you use the <option role="hg-opt-diff">--git</option> option to <command role="hg-cmd">hg diff</command>, it will |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
180 display <command>git</command>-compatible diffs that <emphasis>can</emphasis> display this |
132
e1e2f3e0256a
Start command reference, with the diff command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
181 extra information. |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
182 </para> |
132
e1e2f3e0256a
Start command reference, with the diff command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
183 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
184 <para id="x_679">The second possible reason that <command role="hg-cmd">hg diff</command> might be printing diffs |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
185 for a subset of the files displayed by <command role="hg-cmd">hg status</command> is that if you |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
186 invoke it without any arguments, <command role="hg-cmd">hg diff</command> prints diffs against the |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
187 first parent of the working directory. If you have run <command role="hg-cmd">hg merge</command> |
132
e1e2f3e0256a
Start command reference, with the diff command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
188 to merge two changesets, but you haven't yet committed the results of |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
189 the merge, your working directory has two parents (use <command role="hg-cmd">hg parents</command> |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
190 to see them). While <command role="hg-cmd">hg status</command> prints modifications relative to |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
191 <emphasis>both</emphasis> parents after an uncommitted merge, <command role="hg-cmd">hg diff</command> still |
132
e1e2f3e0256a
Start command reference, with the diff command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
192 operates relative only to the first parent. You can get it to print |
e1e2f3e0256a
Start command reference, with the diff command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
193 diffs relative to the second parent by specifying that parent with the |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
194 <option role="hg-opt-diff">-r</option> option. There is no way to print diffs relative to |
132
e1e2f3e0256a
Start command reference, with the diff command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
195 both parents. |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
196 </para> |
132
e1e2f3e0256a
Start command reference, with the diff command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
197 |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
198 </sect3> |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
199 <sect3> |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
200 <title>Generating safe binary diffs</title> |
132
e1e2f3e0256a
Start command reference, with the diff command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
201 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
202 <para id="x_67a">If you use the <option role="hg-opt-diff">-a</option> option to force Mercurial to print |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
203 diffs of files that are either <quote>mostly text</quote> or contain lots of |
132
e1e2f3e0256a
Start command reference, with the diff command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
204 binary data, those diffs cannot subsequently be applied by either |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
205 Mercurial's <command role="hg-cmd">hg import</command> command or the system's <command>patch</command> |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
206 command. |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
207 </para> |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
208 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
209 <para id="x_67b">If you want to generate a diff of a binary file that is safe to use as |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
210 input for <command role="hg-cmd">hg import</command>, use the <command role="hg-cmd">hg diff</command>{--git} option when you |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
211 generate the patch. The system <command>patch</command> command cannot handle |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
212 binary patches at all. |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
213 </para> |
132
e1e2f3e0256a
Start command reference, with the diff command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
214 |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
215 </sect3> |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
216 </sect2> |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
217 </appendix> |
132
e1e2f3e0256a
Start command reference, with the diff command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
218 |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
219 <!-- |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
220 local variables: |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
221 sgml-parent-document: ("00book.xml" "book" "appendix") |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
222 end: |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
223 --> |