~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/log.py

  • Committer: Martin Pool
  • Date: 2005-07-07 10:31:36 UTC
  • Revision ID: mbp@sourcefrog.net-20050707103135-9b4d911d8df6e880
- fix pwk help

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,
93
 
             search=None):
 
92
             end_revision=None):
94
93
    """Write out human-readable log of commits to this branch.
95
94
 
96
95
    lf
125
124
    if specific_fileid:
126
125
        mutter('get log for file_id %r' % specific_fileid)
127
126
 
128
 
    if search is not None:
129
 
        import re
130
 
        searchRE = re.compile(search, re.IGNORECASE)
131
 
    else:
132
 
        searchRE = None
133
 
 
134
127
    which_revs = branch.enum_history(direction)
135
128
    which_revs = [x for x in which_revs if (
136
129
            (start_revision is None or x[0] >= start_revision)
153
146
            # although we calculated it, throw it away without display
154
147
            delta = None
155
148
 
156
 
        if searchRE is None or searchRE.search(rev.message):
157
 
            lf.show(revno, rev, delta)
 
149
        lf.show(revno, rev, delta)
158
150
 
159
151
 
160
152
 
184
176
        if last_revno:
185
177
            yield last_revno, last_revision, compare_trees(this_tree, last_tree, False)
186
178
 
187
 
        this_tree = EmptyTree(branch.get_root_id())
188
 
 
189
179
        last_revno = revno
190
180
        last_revision = this_revision
191
181
        last_tree = this_tree
192
182
 
193
183
    if last_revno:
194
184
        if last_revno == 1:
195
 
            this_tree = EmptyTree(branch.get_root_id())
 
185
            this_tree = EmptyTree()
196
186
        else:
197
187
            this_revno = last_revno - 1
198
188
            this_revision_id = branch.revision_history()[this_revno]
214
204
    from diff import compare_trees
215
205
 
216
206
    last_revno = last_revision_id = last_tree = None
217
 
    prev_tree = EmptyTree(branch.get_root_id())
218
 
 
219
207
    for revno, revision_id in which_revs:
220
208
        this_tree = branch.revision_tree(revision_id)
221
209
        this_revision = branch.get_revision(revision_id)
222
210
 
223
211
        if not last_revno:
224
212
            if revno == 1:
225
 
                last_tree = EmptyTree(branch.get_root_id())
 
213
                last_tree = EmptyTree()
226
214
            else:
227
215
                last_revno = revno - 1
228
216
                last_revision_id = branch.revision_history()[last_revno]