Show More
@@ -3276,7 +3276,7 b' statemod.addunfinished(' | |||||
3276 | b'diff', |
|
3276 | b'diff', | |
3277 | None, |
|
3277 | None, | |
3278 | _( |
|
3278 | _( | |
3279 |
b' |
|
3279 | b'search revision differences for when the pattern was added ' | |
3280 | b'or removed' |
|
3280 | b'or removed' | |
3281 | ), |
|
3281 | ), | |
3282 | ), |
|
3282 | ), | |
@@ -3302,7 +3302,7 b' statemod.addunfinished(' | |||||
3302 | b'r', |
|
3302 | b'r', | |
3303 | b'rev', |
|
3303 | b'rev', | |
3304 | [], |
|
3304 | [], | |
3305 |
_(b' |
|
3305 | _(b'search files changed within revision range'), | |
3306 | _(b'REV'), |
|
3306 | _(b'REV'), | |
3307 | ), |
|
3307 | ), | |
3308 | ( |
|
3308 | ( | |
@@ -3324,23 +3324,27 b' statemod.addunfinished(' | |||||
3324 | intents={INTENT_READONLY}, |
|
3324 | intents={INTENT_READONLY}, | |
3325 | ) |
|
3325 | ) | |
3326 | def grep(ui, repo, pattern, *pats, **opts): |
|
3326 | def grep(ui, repo, pattern, *pats, **opts): | |
3327 |
"""search |
|
3327 | """search for a pattern in specified files | |
3328 |
|
3328 | |||
3329 |
Search revision history for a regular |
|
3329 | Search the working directory or revision history for a regular | |
3330 | files or the entire project. |
|
3330 | expression in the specified files for the entire repository. | |
3331 |
|
3331 | |||
3332 |
By default, grep |
|
3332 | By default, grep searches the repository files in the working | |
3333 | file in which it finds a match. To get it to print every revision |
|
3333 | directory and prints the files where it finds a match. To specify | |
3334 | that contains a change in match status ("-" for a match that becomes |
|
3334 | historical revisions instead of the working directory, use the | |
3335 | a non-match, or "+" for a non-match that becomes a match), use the |
|
3335 | --rev flag. | |
3336 | --diff flag. |
|
3336 | ||
|
3337 | To search instead historical revision differences that contains a | |||
|
3338 | change in match status ("-" for a match that becomes a non-match, | |||
|
3339 | or "+" for a non-match that becomes a match), use the --diff flag. | |||
3337 |
|
3340 | |||
3338 | PATTERN can be any Python (roughly Perl-compatible) regular |
|
3341 | PATTERN can be any Python (roughly Perl-compatible) regular | |
3339 | expression. |
|
3342 | expression. | |
3340 |
|
3343 | |||
3341 |
If no FILEs are specified |
|
3344 | If no FILEs are specified and the --rev flag isn't supplied, all | |
3342 | the repository are searched, including those that don't exist in the |
|
3345 | files in the working directory are searched. When using the --rev | |
3343 | current branch or have been deleted in a prior changeset. |
|
3346 | flag and specifying FILEs, use the --follow argument to also | |
|
3347 | follow the specified FILEs across renames and copies. | |||
3344 |
|
3348 | |||
3345 | .. container:: verbose |
|
3349 | .. container:: verbose | |
3346 |
|
3350 | |||
@@ -3363,6 +3367,7 b' def grep(ui, repo, pattern, *pats, **opt' | |||||
3363 | See :hg:`help templates.operators` for the list expansion syntax. |
|
3367 | See :hg:`help templates.operators` for the list expansion syntax. | |
3364 |
|
3368 | |||
3365 | Returns 0 if a match is found, 1 otherwise. |
|
3369 | Returns 0 if a match is found, 1 otherwise. | |
|
3370 | ||||
3366 | """ |
|
3371 | """ | |
3367 | opts = pycompat.byteskwargs(opts) |
|
3372 | opts = pycompat.byteskwargs(opts) | |
3368 | diff = opts.get(b'all') or opts.get(b'diff') |
|
3373 | diff = opts.get(b'all') or opts.get(b'diff') |
@@ -336,7 +336,7 b' Testing -h/--help:' | |||||
336 | cat output the current or given revision of files |
|
336 | cat output the current or given revision of files | |
337 | copy mark files as copied for the next commit |
|
337 | copy mark files as copied for the next commit | |
338 | diff diff repository (or selected files) |
|
338 | diff diff repository (or selected files) | |
339 |
grep search |
|
339 | grep search for a pattern in specified files | |
340 |
|
340 | |||
341 | Change navigation: |
|
341 | Change navigation: | |
342 |
|
342 | |||
@@ -468,7 +468,7 b' Testing -h/--help:' | |||||
468 | cat output the current or given revision of files |
|
468 | cat output the current or given revision of files | |
469 | copy mark files as copied for the next commit |
|
469 | copy mark files as copied for the next commit | |
470 | diff diff repository (or selected files) |
|
470 | diff diff repository (or selected files) | |
471 |
grep search |
|
471 | grep search for a pattern in specified files | |
472 |
|
472 | |||
473 | Change navigation: |
|
473 | Change navigation: | |
474 |
|
474 |
@@ -40,7 +40,7 b' Test hiding some commands (which also ha' | |||||
40 | cat output the current or given revision of files |
|
40 | cat output the current or given revision of files | |
41 | copy mark files as copied for the next commit |
|
41 | copy mark files as copied for the next commit | |
42 | diff diff repository (or selected files) |
|
42 | diff diff repository (or selected files) | |
43 |
grep search |
|
43 | grep search for a pattern in specified files | |
44 |
|
44 | |||
45 | Change navigation: |
|
45 | Change navigation: | |
46 |
|
46 | |||
@@ -176,7 +176,7 b' Test hiding some topics.' | |||||
176 | cat output the current or given revision of files |
|
176 | cat output the current or given revision of files | |
177 | copy mark files as copied for the next commit |
|
177 | copy mark files as copied for the next commit | |
178 | diff diff repository (or selected files) |
|
178 | diff diff repository (or selected files) | |
179 |
grep search |
|
179 | grep search for a pattern in specified files | |
180 |
|
180 | |||
181 | Change navigation: |
|
181 | Change navigation: | |
182 |
|
182 |
@@ -92,7 +92,7 b' the extension is unknown.' | |||||
92 | cat output the current or given revision of files |
|
92 | cat output the current or given revision of files | |
93 | copy mark files as copied for the next commit |
|
93 | copy mark files as copied for the next commit | |
94 | diff diff repository (or selected files) |
|
94 | diff diff repository (or selected files) | |
95 |
grep search |
|
95 | grep search for a pattern in specified files | |
96 |
|
96 | |||
97 | Change navigation: |
|
97 | Change navigation: | |
98 |
|
98 | |||
@@ -220,7 +220,7 b' the extension is unknown.' | |||||
220 | cat output the current or given revision of files |
|
220 | cat output the current or given revision of files | |
221 | copy mark files as copied for the next commit |
|
221 | copy mark files as copied for the next commit | |
222 | diff diff repository (or selected files) |
|
222 | diff diff repository (or selected files) | |
223 |
grep search |
|
223 | grep search for a pattern in specified files | |
224 |
|
224 | |||
225 | Change navigation: |
|
225 | Change navigation: | |
226 |
|
226 | |||
@@ -2590,7 +2590,7 b' Dish up an empty repo; serve it cold.' | |||||
2590 | grep |
|
2590 | grep | |
2591 | </a> |
|
2591 | </a> | |
2592 | </td><td> |
|
2592 | </td><td> | |
2593 |
search |
|
2593 | search for a pattern in specified files | |
2594 | </td></tr> |
|
2594 | </td></tr> | |
2595 | <tr><td> |
|
2595 | <tr><td> | |
2596 | <a href="/help/hashelp"> |
|
2596 | <a href="/help/hashelp"> |
@@ -2005,7 +2005,7 b' help/ shows help topics' | |||||
2005 | "topic": "graft" |
|
2005 | "topic": "graft" | |
2006 | }, |
|
2006 | }, | |
2007 | { |
|
2007 | { | |
2008 |
"summary": "search |
|
2008 | "summary": "search for a pattern in specified files", | |
2009 | "topic": "grep" |
|
2009 | "topic": "grep" | |
2010 | }, |
|
2010 | }, | |
2011 | { |
|
2011 | { |
General Comments 0
You need to be logged in to leave comments.
Login now