~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/log.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-05-25 04:33:32 UTC
  • mfrom: (2493.1.1 bzr.ab.integration)
  • Revision ID: pqm@pqm.ubuntu.com-20070525043332-aw7j04dvjy6ua1v9
Merge log --limit (Kent Gibson)

Show diffs side-by-side

added added

removed removed

Lines of Context:
132
132
             direction='reverse',
133
133
             start_revision=None,
134
134
             end_revision=None,
135
 
             search=None):
 
135
             search=None,
 
136
             limit=None):
136
137
    """Write out human-readable log of commits to this branch.
137
138
 
138
139
    lf
154
155
 
155
156
    end_revision
156
157
        If not None, only show revisions <= end_revision
 
158
 
 
159
    search
 
160
        If not None, only show revisions with matching commit messages
 
161
 
 
162
    limit
 
163
        If not None or 0, only show limit revisions
157
164
    """
158
165
    branch.lock_read()
159
166
    try:
161
168
            lf.begin_log()
162
169
 
163
170
        _show_log(branch, lf, specific_fileid, verbose, direction,
164
 
                  start_revision, end_revision, search)
 
171
                  start_revision, end_revision, search, limit)
165
172
 
166
173
        if getattr(lf, 'end_log', None):
167
174
            lf.end_log()
175
182
             direction='reverse',
176
183
             start_revision=None,
177
184
             end_revision=None,
178
 
             search=None):
 
185
             search=None,
 
186
             limit=None):
179
187
    """Worker function for show_log - see show_log."""
180
188
    from bzrlib.osutils import format_date
181
189
    from bzrlib.errors import BzrCheckError
282
290
            num = min(int(num * 1.5), 200)
283
291
 
284
292
    # now we just print all the revisions
 
293
    log_count = 0
285
294
    for ((rev_id, revno, merge_depth), (rev, delta)) in \
286
295
         izip(view_revisions, iter_revisions()):
287
296
 
309
318
                                            rev_tag_dict.get(rev_id))
310
319
                    else:
311
320
                        lf.show_merge_revno(rev, merge_depth, revno)
 
321
        if limit:
 
322
            log_count += 1
 
323
            if log_count >= limit:
 
324
                break
312
325
 
313
326
 
314
327
def _get_revisions_touching_file_id(branch, file_id, mainline_revisions,