~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: 2011-08-03 04:57:59 UTC
  • mfrom: (6042.1.2 fix-log-2)
  • Revision ID: pqm@pqm.ubuntu.com-20110803045759-1lrr8eymve8ofldr
(mbp) Log levels are no longer reset to what the log formatter supports (bug
 747958) (Thomi Richards)

Show diffs side-by-side

added added

removed removed

Lines of Context:
183
183
        if None or 0.
184
184
 
185
185
    :param show_diff: If True, output a diff after each revision.
186
 
    
 
186
 
187
187
    :param match: Dictionary of search lists to use when matching revision
188
188
      properties.
189
189
    """
219
219
# make_log_request_dict() below
220
220
_DEFAULT_REQUEST_PARAMS = {
221
221
    'direction': 'reverse',
222
 
    'levels': 1,
 
222
    'levels': None,
223
223
    'generate_tags': True,
224
224
    'exclude_common_ancestry': False,
225
225
    '_match_using_deltas': True,
228
228
 
229
229
def make_log_request_dict(direction='reverse', specific_fileids=None,
230
230
                          start_revision=None, end_revision=None, limit=None,
231
 
                          message_search=None, levels=1, generate_tags=True,
 
231
                          message_search=None, levels=None, generate_tags=True,
232
232
                          delta_type=None,
233
233
                          diff_type=None, _match_using_deltas=True,
234
234
                          exclude_common_ancestry=False, match=None,
259
259
      matching commit messages
260
260
 
261
261
    :param levels: the number of levels of revisions to
262
 
      generate; 1 for just the mainline; 0 for all levels.
 
262
      generate; 1 for just the mainline; 0 for all levels, or None for
 
263
      a sensible default.
263
264
 
264
265
    :param generate_tags: If True, include tags for matched revisions.
265
266
`
282
283
      range operator or as a graph difference.
283
284
 
284
285
    :param signature: show digital signature information
285
 
      
 
286
 
286
287
    :param match: Dictionary of list of search strings to use when filtering
287
288
      revisions. Keys can be 'message', 'author', 'committer', 'bugs' or
288
 
      the empty string to match any of the preceding properties. 
289
 
      
 
289
      the empty string to match any of the preceding properties.
 
290
 
290
291
    """
291
292
    # Take care of old style message_search parameter
292
293
    if message_search:
325
326
 
326
327
def format_signature_validity(rev_id, repo):
327
328
    """get the signature validity
328
 
    
 
329
 
329
330
    :param rev_id: revision id to validate
330
331
    :param repo: repository of revision
331
332
    :return: human readable string to print to log
394
395
        # Tweak the LogRequest based on what the LogFormatter can handle.
395
396
        # (There's no point generating stuff if the formatter can't display it.)
396
397
        rqst = self.rqst
397
 
        rqst['levels'] = lf.get_levels()
 
398
        if rqst['levels'] is None or lf.get_levels() > rqst['levels']:
 
399
            # user didn't specify levels, use whatever the LF can handle:
 
400
            rqst['levels'] = lf.get_levels()
 
401
 
398
402
        if not getattr(lf, 'supports_tags', False):
399
403
            rqst['generate_tags'] = False
400
404
        if not getattr(lf, 'supports_delta', False):
412
416
 
413
417
    def _generator_factory(self, branch, rqst):
414
418
        """Make the LogGenerator object to use.
415
 
        
 
419
 
416
420
        Subclasses may wish to override this.
417
421
        """
418
422
        return _DefaultLogGenerator(branch, rqst)
967
971
 
968
972
def _update_fileids(delta, fileids, stop_on):
969
973
    """Update the set of file-ids to search based on file lifecycle events.
970
 
    
 
974
 
971
975
    :param fileids: a set of fileids to update
972
976
    :param stop_on: either 'add' or 'remove' - take file-ids out of the
973
977
      fileids set once their add or remove entry is detected respectively
1344
1348
        """Create a LogFormatter.
1345
1349
 
1346
1350
        :param to_file: the file to output to
1347
 
        :param to_exact_file: if set, gives an output stream to which 
 
1351
        :param to_exact_file: if set, gives an output stream to which
1348
1352
             non-Unicode diffs are written.
1349
1353
        :param show_ids: if True, revision-ids are to be displayed
1350
1354
        :param show_timezone: the timezone to use
1586
1590
        if revision.delta is not None:
1587
1591
            # Use the standard status output to display changes
1588
1592
            from bzrlib.delta import report_delta
1589
 
            report_delta(to_file, revision.delta, short_status=False, 
 
1593
            report_delta(to_file, revision.delta, short_status=False,
1590
1594
                         show_ids=self.show_ids, indent=indent)
1591
1595
        if revision.diff is not None:
1592
1596
            to_file.write(indent + 'diff:\n')
1658
1662
        if revision.delta is not None:
1659
1663
            # Use the standard status output to display changes
1660
1664
            from bzrlib.delta import report_delta
1661
 
            report_delta(to_file, revision.delta, 
1662
 
                         short_status=self.delta_format==1, 
 
1665
            report_delta(to_file, revision.delta,
 
1666
                         short_status=self.delta_format==1,
1663
1667
                         show_ids=self.show_ids, indent=indent + offset)
1664
1668
        if revision.diff is not None:
1665
1669
            self.show_diff(self.to_exact_file, revision.diff, '      ')