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