.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 \ . 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 \