/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/grep.py

  • Committer: Jelmer Vernooij
  • Date: 2019-03-02 22:31:28 UTC
  • mfrom: (7291 work)
  • mto: This revision was merged to the branch mainline in revision 7293.
  • Revision ID: jelmer@jelmer.uk-20190302223128-0qk1i5tozmzq5nyq
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# Copyright (C) 2010 Canonical Ltd
2
 
#
 
2
 
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
5
5
# the Free Software Foundation; either version 2 of the License, or
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
from __future__ import absolute_import
18
18
 
19
19
import re
20
20
 
21
 
from ...lazy_import import lazy_import
 
21
from .lazy_import import lazy_import
22
22
lazy_import(globals(), """
23
23
from fnmatch import fnmatch
24
24
 
25
25
from breezy._termcolor import color_string, FG
26
26
 
27
27
from breezy import (
 
28
    diff,
 
29
    )
 
30
""")
 
31
from . import (
28
32
    controldir,
29
 
    diff,
30
33
    errors,
31
 
    lazy_regex,
 
34
    osutils,
32
35
    revision as _mod_revision,
33
 
    )
34
 
""")
35
 
from breezy import (
36
 
    osutils,
37
36
    trace,
38
37
    )
39
 
from breezy.revisionspec import (
 
38
from .revisionspec import (
40
39
    RevisionSpec,
41
40
    RevisionSpec_revid,
42
41
    RevisionSpec_revno,
43
42
    )
44
 
from breezy.sixish import (
 
43
from .sixish import (
45
44
    BytesIO,
46
45
    )
47
46
 
52
51
    """Raised when a revision is not on left-hand history."""
53
52
 
54
53
 
 
54
class GrepOptions(object):
 
55
    """Container to pass around grep options.
 
56
 
 
57
    This class is used as a container to pass around user option and
 
58
    some other params (like outf) to processing functions. This makes
 
59
    it easier to add more options as grep evolves.
 
60
    """
 
61
    verbose = False
 
62
    ignore_case = False
 
63
    no_recursive = False
 
64
    from_root = False
 
65
    null = False
 
66
    levels = None
 
67
    line_number = False
 
68
    path_list = None
 
69
    revision = None
 
70
    pattern = None
 
71
    include = None
 
72
    exclude = None
 
73
    fixed_string = False
 
74
    files_with_matches = False
 
75
    files_without_match = False
 
76
    color = None
 
77
    diff = False
 
78
 
 
79
    # derived options
 
80
    recursive = None
 
81
    eol_marker = None
 
82
    patternc = None
 
83
    sub_patternc = None
 
84
    print_revno = None
 
85
    fixed_string = None
 
86
    outf = None
 
87
    show_color = False
 
88
 
 
89
 
55
90
def _rev_on_mainline(rev_tuple):
56
91
    """returns True is rev tuple is on mainline"""
57
92
    if len(rev_tuple) == 1: