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
|
.TH HG GREP "" "" ""
.SH NAME
hg grep \- search for a pattern in specified files
.\" Man page generated from reStructuredText.
.
.SH SYNOPSIS
.sp
.nf
.ft C
hg grep [\-\-diff] [OPTION]... PATTERN [FILE]...
.ft P
.fi
.SH DESCRIPTION
.sp
Search the working directory or revision history for a regular
expression in the specified files for the entire repository.
.sp
By default, grep searches the repository files in the working
directory and prints the files where it finds a match. To specify
historical revisions instead of the working directory, use the
\-\-rev flag.
.sp
To search instead historical revision differences that contains a
change in match status ("\-" for a match that becomes a non\-match,
or "+" for a non\-match that becomes a match), use the \-\-diff flag.
.sp
PATTERN can be any Python (roughly Perl\-compatible) regular
expression.
.sp
If no FILEs are specified and the \-\-rev flag isn\(aqt supplied, all
files in the working directory are searched. When using the \-\-rev
flag and specifying FILEs, use the \-\-follow argument to also
follow the specified FILEs across renames and copies.
.sp
Template:
.sp
The following keywords are supported in addition to the common template
keywords and functions. See also \%\fBhg help templates\fP\:.
.INDENT 0.0
.TP
.B change
.
String. Character denoting insertion \fB+\fP or removal \fB\-\fP.
Available if \fB\-\-diff\fP is specified.
.TP
.B lineno
.
Integer. Line number of the match.
.TP
.B path
.
String. Repository\-absolute path of the file.
.TP
.B texts
.
List of text chunks.
.UNINDENT
.sp
And each entry of \fB{texts}\fP provides the following sub\-keywords.
.INDENT 0.0
.TP
.B matched
.
Boolean. True if the chunk matches the specified pattern.
.TP
.B text
.
String. Chunk content.
.UNINDENT
.sp
See \%\fBhg help templates.operators\fP\: for the list expansion syntax.
.sp
Returns 0 if a match is found, 1 otherwise.
.SH OPTIONS
.INDENT 0.0
.TP
.B \-0, \-\-print0
.
end fields with NUL
.TP
.B \-\-all
.
an alias to \-\-diff (DEPRECATED)
.TP
.B \-\-diff
.
search revision differences for when the pattern was added or removed
.TP
.B \-a, \-\-text
.
treat all files as text
.TP
.B \-f, \-\-follow
.
follow changeset history, or file history across copies and renames
.TP
.B \-i, \-\-ignore\-case
.
ignore case when matching
.TP
.B \-l, \-\-files\-with\-matches
.
print only filenames and revisions that match
.TP
.B \-n, \-\-line\-number
.
print matching line numbers
.TP
.BI \-r, \-\-rev \ <REV[+]>
.
search files changed within revision range
.TP
.B \-\-all\-files
.
include all files in the changeset while grepping (DEPRECATED)
.TP
.B \-u, \-\-user
.
list the author (long with \-v)
.TP
.B \-d, \-\-date
.
list the date (short with \-q)
.TP
.BI \-T, \-\-template \ <TEMPLATE>
.
display with template
.TP
.BI \-I, \-\-include \ <PATTERN[+]>
.
include names matching the given patterns
.TP
.BI \-X, \-\-exclude \ <PATTERN[+]>
.
exclude names matching the given patterns
.UNINDENT
.sp
[+] marked option can be specified multiple times
.\" Generated by docutils manpage writer.
.\"
.
|