~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/log.py

  • Committer: Neil Martinsen-Burrell
  • Date: 2009-12-11 13:44:05 UTC
  • mto: This revision was merged to the branch mainline in revision 4916.
  • Revision ID: nmb@wartburg.edu-20091211134405-36njvdrqhco95s79
switch should use directory services when creating a branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
1293
1293
    preferred_levels = 0
1294
1294
 
1295
1295
    def __init__(self, to_file, show_ids=False, show_timezone='original',
1296
 
            delta_format=None, levels=None, show_advice=False,
1297
 
            to_exact_file=None):
 
1296
            delta_format=None, levels=None, show_advice=False):
1298
1297
        """Create a LogFormatter.
1299
1298
 
1300
1299
        :param to_file: the file to output to
1301
 
        :param to_exact_file: if set, gives an output stream to which 
1302
 
             non-Unicode diffs are written.
1303
1300
        :param show_ids: if True, revision-ids are to be displayed
1304
1301
        :param show_timezone: the timezone to use
1305
1302
        :param delta_format: the level of delta information to display
1312
1309
        self.to_file = to_file
1313
1310
        # 'exact' stream used to show diff, it should print content 'as is'
1314
1311
        # and should not try to decode/encode it to unicode to avoid bug #328007
1315
 
        if to_exact_file is not None:
1316
 
            self.to_exact_file = to_exact_file
1317
 
        else:
1318
 
            # XXX: somewhat hacky; this assumes it's a codec writer; it's better
1319
 
            # for code that expects to get diffs to pass in the exact file
1320
 
            # stream
1321
 
            self.to_exact_file = getattr(to_file, 'stream', to_file)
 
1312
        self.to_exact_file = getattr(to_file, 'stream', to_file)
1322
1313
        self.show_ids = show_ids
1323
1314
        self.show_timezone = show_timezone
1324
1315
        if delta_format is None:
1503
1494
                                short_status=False)
1504
1495
        if revision.diff is not None:
1505
1496
            to_file.write(indent + 'diff:\n')
1506
 
            to_file.flush()
1507
1497
            # Note: we explicitly don't indent the diff (relative to the
1508
1498
            # revision information) so that the output can be fed to patch -p0
1509
1499
            self.show_diff(self.to_exact_file, revision.diff, indent)
1510
 
            self.to_exact_file.flush()
1511
1500
 
1512
1501
    def get_advice_separator(self):
1513
1502
        """Get the text separating the log from the closing advice."""