Show More
@@ -795,18 +795,14 b' def forget(ui, repo, *pats, **opts):' | |||||
795 | ui.status('forgetting ', rel, '\n') |
|
795 | ui.status('forgetting ', rel, '\n') | |
796 | repo.forget(forget) |
|
796 | repo.forget(forget) | |
797 |
|
797 | |||
798 |
def grep(ui, repo, pattern |
|
798 | def grep(ui, repo, pattern, *pats, **opts): | |
799 | """search for a pattern in specified files and revisions""" |
|
799 | """search for a pattern in specified files and revisions""" | |
800 | if pattern is None: |
|
|||
801 | pattern = opts['regexp'] |
|
|||
802 | if not pattern: |
|
|||
803 | raise util.Abort('no pattern to search for') |
|
|||
804 | reflags = 0 |
|
800 | reflags = 0 | |
805 | if opts['ignore_case']: |
|
801 | if opts['ignore_case']: | |
806 | reflags |= re.I |
|
802 | reflags |= re.I | |
807 | regexp = re.compile(pattern, reflags) |
|
803 | regexp = re.compile(pattern, reflags) | |
808 | sep, end = ':', '\n' |
|
804 | sep, end = ':', '\n' | |
809 |
if |
|
805 | if opts['print0']: | |
810 | sep = end = '\0' |
|
806 | sep = end = '\0' | |
811 |
|
807 | |||
812 | fcache = {} |
|
808 | fcache = {} | |
@@ -1543,17 +1539,11 b' table = {' | |||||
1543 | [('0', 'print0', None, 'terminate file names with NUL'), |
|
1539 | [('0', 'print0', None, 'terminate file names with NUL'), | |
1544 | ('I', 'include', [], 'include path in search'), |
|
1540 | ('I', 'include', [], 'include path in search'), | |
1545 | ('X', 'exclude', [], 'include path in search'), |
|
1541 | ('X', 'exclude', [], 'include path in search'), | |
1546 | ('Z', 'null', None, 'terminate file names with NUL'), |
|
|||
1547 | ('a', 'all-revs', '', 'search all revs'), |
|
|||
1548 | ('e', 'regexp', '', 'pattern to search for'), |
|
|||
1549 | ('f', 'full-path', None, 'print complete paths'), |
|
|||
1550 | ('i', 'ignore-case', None, 'ignore case when matching'), |
|
1542 | ('i', 'ignore-case', None, 'ignore case when matching'), | |
1551 | ('l', 'files-with-matches', None, 'print names of files with matches'), |
|
1543 | ('l', 'files-with-matches', None, 'print names of files with matches'), | |
1552 | ('n', 'line-number', '', 'print line numbers'), |
|
1544 | ('n', 'line-number', '', 'print line numbers'), | |
1553 | ('r', 'rev', [], 'search in revision rev'), |
|
1545 | ('r', 'rev', [], 'search in revision rev')], | |
1554 | ('s', 'no-messages', None, 'do not print error messages'), |
|
1546 | "hg grep [OPTION]... PATTERN [FILE]..."), | |
1555 | ('v', 'invert-match', None, 'select non-matching lines')], |
|
|||
1556 | "hg grep [OPTION]... [PATTERN] [FILE]..."), |
|
|||
1557 | "heads": |
|
1547 | "heads": | |
1558 | (heads, |
|
1548 | (heads, | |
1559 | [('b', 'branches', None, 'find branch info')], |
|
1549 | [('b', 'branches', None, 'find branch info')], |
General Comments 0
You need to be logged in to leave comments.
Login now