| 1 |
.TH HG DIFF "" "" "" |
| 2 |
.SH NAME |
| 3 |
hg diff \- diff repository (or selected files) |
| 4 |
.\" Man page generated from reStructuredText. |
| 5 |
. |
| 6 |
.SH SYNOPSIS |
| 7 |
.sp |
| 8 |
.nf |
| 9 |
.ft C |
| 10 |
hg diff [OPTION]... ([\-c REV] | [\-\-from REV1] [\-\-to REV2]) [FILE]... |
| 11 |
.ft P |
| 12 |
.fi |
| 13 |
.SH DESCRIPTION |
| 14 |
.sp |
| 15 |
Show differences between revisions for the specified files. |
| 16 |
.sp |
| 17 |
Differences between files are shown using the unified diff format. |
| 18 |
.IP Note |
| 19 |
. |
| 20 |
\%\fBhg diff\fP\: may generate unexpected results for merges, as it will |
| 21 |
default to comparing against the working directory\(aqs first |
| 22 |
parent changeset if no revisions are specified. To diff against the |
| 23 |
conflict regions, you can use \fI\-\-config diff.merge=yes\fP. |
| 24 |
.RE |
| 25 |
.sp |
| 26 |
By default, the working directory files are compared to its first parent. To |
| 27 |
see the differences from another revision, use \-\-from. To see the difference |
| 28 |
to another revision, use \-\-to. For example, \%\fBhg diff \-\-from .^\fP\: will show |
| 29 |
the differences from the working copy\(aqs grandparent to the working copy, |
| 30 |
\%\fBhg diff \-\-to .\fP\: will show the diff from the working copy to its parent |
| 31 |
(i.e. the reverse of the default), and \%\fBhg diff \-\-from 1.0 \-\-to 1.2\fP\: will |
| 32 |
show the diff between those two revisions. |
| 33 |
.sp |
| 34 |
Alternatively you can specify \-c/\-\-change with a revision to see the changes |
| 35 |
in that changeset relative to its first parent (i.e. \%\fBhg diff \-c 42\fP\: is |
| 36 |
equivalent to \%\fBhg diff \-\-from 42^ \-\-to 42\fP\:) |
| 37 |
.sp |
| 38 |
Without the \-a/\-\-text option, diff will avoid generating diffs of |
| 39 |
files it detects as binary. With \-a, diff will generate a diff |
| 40 |
anyway, probably with undesirable results. |
| 41 |
.sp |
| 42 |
Use the \-g/\-\-git option to generate diffs in the git extended diff |
| 43 |
format. For more information, read \%\fBhg help diffs\fP\:. |
| 44 |
.sp |
| 45 |
Examples: |
| 46 |
.INDENT 0.0 |
| 47 |
.IP \(bu 2 |
| 48 |
. |
| 49 |
compare a file in the current working directory to its parent: |
| 50 |
.sp |
| 51 |
.nf |
| 52 |
.ft C |
| 53 |
hg diff foo.c |
| 54 |
.ft P |
| 55 |
.fi |
| 56 |
.IP \(bu 2 |
| 57 |
. |
| 58 |
compare two historical versions of a directory, with rename info: |
| 59 |
.sp |
| 60 |
.nf |
| 61 |
.ft C |
| 62 |
hg diff \-\-git \-\-from 1.0 \-\-to 1.2 lib/ |
| 63 |
.ft P |
| 64 |
.fi |
| 65 |
.IP \(bu 2 |
| 66 |
. |
| 67 |
get change stats relative to the last change on some date: |
| 68 |
.sp |
| 69 |
.nf |
| 70 |
.ft C |
| 71 |
hg diff \-\-stat \-\-from "date(\(aqmay 2\(aq)" |
| 72 |
.ft P |
| 73 |
.fi |
| 74 |
.IP \(bu 2 |
| 75 |
. |
| 76 |
diff all newly\-added files that contain a keyword: |
| 77 |
.sp |
| 78 |
.nf |
| 79 |
.ft C |
| 80 |
hg diff "set:added() and grep(GNU)" |
| 81 |
.ft P |
| 82 |
.fi |
| 83 |
.IP \(bu 2 |
| 84 |
. |
| 85 |
compare a revision and its parents: |
| 86 |
.sp |
| 87 |
.nf |
| 88 |
.ft C |
| 89 |
hg diff \-c 9353 # compare against first parent |
| 90 |
hg diff \-\-from 9353^ \-\-to 9353 # same using revset syntax |
| 91 |
hg diff \-\-from 9353^2 \-\-to 9353 # compare against the second parent |
| 92 |
.ft P |
| 93 |
.fi |
| 94 |
.UNINDENT |
| 95 |
.sp |
| 96 |
Returns 0 on success. |
| 97 |
.SH OPTIONS |
| 98 |
.INDENT 0.0 |
| 99 |
.TP |
| 100 |
.BI \-r, \-\-rev \ <REV[+]> |
| 101 |
. |
| 102 |
revision (DEPRECATED) |
| 103 |
.TP |
| 104 |
.BI \-\-from \ <REV1> |
| 105 |
. |
| 106 |
revision to diff from |
| 107 |
.TP |
| 108 |
.BI \-\-to \ <REV2> |
| 109 |
. |
| 110 |
revision to diff to |
| 111 |
.TP |
| 112 |
.BI \-c, \-\-change \ <REV> |
| 113 |
. |
| 114 |
change made by revision |
| 115 |
.TP |
| 116 |
.B \-\-ignore\-changes\-from\-ancestors |
| 117 |
. |
| 118 |
only compare the change made by the selected revision (EXPERIMENTAL) |
| 119 |
.TP |
| 120 |
.B \-a, \-\-text |
| 121 |
. |
| 122 |
treat all files as text |
| 123 |
.TP |
| 124 |
.B \-g, \-\-git |
| 125 |
. |
| 126 |
use git extended diff format (DEFAULT: diff.git) |
| 127 |
.TP |
| 128 |
.B \-\-binary |
| 129 |
. |
| 130 |
generate binary diffs in git mode (default) |
| 131 |
.TP |
| 132 |
.B \-\-nodates |
| 133 |
. |
| 134 |
omit dates from diff headers |
| 135 |
.TP |
| 136 |
.B \-\-noprefix |
| 137 |
. |
| 138 |
omit a/ and b/ prefixes from filenames |
| 139 |
.TP |
| 140 |
.B \-p, \-\-show\-function |
| 141 |
. |
| 142 |
show which function each change is in (DEFAULT: diff.showfunc) |
| 143 |
.TP |
| 144 |
.B \-\-reverse |
| 145 |
. |
| 146 |
produce a diff that undoes the changes |
| 147 |
.TP |
| 148 |
.B \-w, \-\-ignore\-all\-space |
| 149 |
. |
| 150 |
ignore white space when comparing lines |
| 151 |
.TP |
| 152 |
.B \-b, \-\-ignore\-space\-change |
| 153 |
. |
| 154 |
ignore changes in the amount of white space |
| 155 |
.TP |
| 156 |
.B \-B, \-\-ignore\-blank\-lines |
| 157 |
. |
| 158 |
ignore changes whose lines are all blank |
| 159 |
.TP |
| 160 |
.B \-Z, \-\-ignore\-space\-at\-eol |
| 161 |
. |
| 162 |
ignore changes in whitespace at EOL |
| 163 |
.TP |
| 164 |
.BI \-U, \-\-unified \ <NUM> |
| 165 |
. |
| 166 |
number of lines of context to show |
| 167 |
.TP |
| 168 |
.B \-\-stat |
| 169 |
. |
| 170 |
output diffstat\-style summary of changes |
| 171 |
.TP |
| 172 |
.BI \-\-root \ <DIR> |
| 173 |
. |
| 174 |
produce diffs relative to subdirectory |
| 175 |
.TP |
| 176 |
.BI \-I, \-\-include \ <PATTERN[+]> |
| 177 |
. |
| 178 |
include names matching the given patterns |
| 179 |
.TP |
| 180 |
.BI \-X, \-\-exclude \ <PATTERN[+]> |
| 181 |
. |
| 182 |
exclude names matching the given patterns |
| 183 |
.TP |
| 184 |
.B \-S, \-\-subrepos |
| 185 |
. |
| 186 |
recurse into subrepositories |
| 187 |
.UNINDENT |
| 188 |
.sp |
| 189 |
[+] marked option can be specified multiple times |
| 190 |
.\" Generated by docutils manpage writer. |
| 191 |
.\" |
| 192 |
. |