19
19
from __future__ import absolute_import
21
from ... import errors
22
from ...commands import Command, display_command
23
from ...option import Option, ListOption
24
from ...config import GlobalConfig
26
from ...sixish import (
30
# FIXME: _parse_levels should be shared with breezy.builtins. this is a copy
21
from bzrlib import errors
22
from bzrlib.commands import Command, display_command
23
from bzrlib.option import Option, ListOption
24
from bzrlib.config import GlobalConfig
26
# FIXME: _parse_levels should be shared with bzrlib.builtins. this is a copy
31
27
# to avoid the error
32
28
# "IllegalUseOfScopeReplacer: ScopeReplacer object '_parse_levels' was used
33
29
# incorrectly: Object already cleaned up, did you assign it to another
109
105
takes_options = [
112
Option('color', type=text_type, argname='when',
108
Option('color', type=str, argname='when',
113
109
help='Show match in color. WHEN is never, always or auto.'),
114
110
Option('diff', short_name='p',
115
111
help='Grep for pattern in changeset for each revision.'),
116
ListOption('exclude', type=text_type, argname='glob', short_name='X',
112
ListOption('exclude', type=str, argname='glob', short_name='X',
117
113
help="Skip files whose base name matches GLOB."),
118
ListOption('include', type=text_type, argname='glob', short_name='I',
114
ListOption('include', type=str, argname='glob', short_name='I',
119
115
help="Search only files whose base name matches GLOB."),
120
116
Option('files-with-matches', short_name='l',
121
117
help='Print only the name of each input file in '
151
147
path_list=None, revision=None, pattern=None, include=None,
152
148
exclude=None, fixed_string=False, files_with_matches=False,
153
149
files_without_match=False, color=None, diff=False):
154
from breezy import _termcolor
155
from breezy.plugins.grep import (
150
from bzrlib import _termcolor
151
from bzrlib.plugins.grep import (