~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/log.py

  • Committer: Martin Pool
  • Date: 2005-07-11 06:41:00 UTC
  • mfrom: (unknown (missing))
  • Revision ID: mbp@sourcefrog.net-20050711064100-c2eb947e0212f487
- patch from john to search for matching commits

Show diffs side-by-side

added added

removed removed

Lines of Context:
89
89
             verbose=False,
90
90
             direction='reverse',
91
91
             start_revision=None,
92
 
             end_revision=None):
 
92
             end_revision=None,
 
93
             search=None):
93
94
    """Write out human-readable log of commits to this branch.
94
95
 
95
96
    lf
124
125
    if specific_fileid:
125
126
        mutter('get log for file_id %r' % specific_fileid)
126
127
 
 
128
    if search is not None:
 
129
        import re
 
130
        searchRE = re.compile(search, re.IGNORECASE)
 
131
    else:
 
132
        searchRE = None
 
133
 
127
134
    which_revs = branch.enum_history(direction)
128
135
    which_revs = [x for x in which_revs if (
129
136
            (start_revision is None or x[0] >= start_revision)
146
153
            # although we calculated it, throw it away without display
147
154
            delta = None
148
155
 
149
 
        lf.show(revno, rev, delta)
 
156
        if searchRE is None or searchRE.search(rev.message):
 
157
            lf.show(revno, rev, delta)
150
158
 
151
159
 
152
160