~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: 2009-03-12 08:38:15 UTC
  • mfrom: (4108.1.4 jamesw-integration)
  • Revision ID: pqm@pqm.ubuntu.com-20090312083815-gngp4va6p39wr31o
(bialix) Fixed problem with `log -p` and non-ascii content of files

Show diffs side-by-side

added added

removed removed

Lines of Context:
1143
1143
          let the log formatter decide.
1144
1144
        """
1145
1145
        self.to_file = to_file
 
1146
        # 'exact' stream used to show diff, it should print content 'as is'
 
1147
        # and should not try to decode/encode it to unicode to avoid bug #328007
 
1148
        self.to_exact_file = getattr(to_file, 'stream', to_file)
1146
1149
        self.show_ids = show_ids
1147
1150
        self.show_timezone = show_timezone
1148
1151
        if delta_format is None:
1246
1249
            to_file.write(indent + 'diff:\n')
1247
1250
            # Note: we explicitly don't indent the diff (relative to the
1248
1251
            # revision information) so that the output can be fed to patch -p0
1249
 
            self.show_diff(to_file, revision.diff, indent)
 
1252
            self.show_diff(self.to_exact_file, revision.diff, indent)
1250
1253
 
1251
1254
 
1252
1255
class ShortLogFormatter(LogFormatter):
1310
1313
            revision.delta.show(to_file, self.show_ids, indent=indent + offset,
1311
1314
                                short_status=self.delta_format==1)
1312
1315
        if revision.diff is not None:
1313
 
            self.show_diff(to_file, revision.diff, '      ')
 
1316
            self.show_diff(self.to_exact_file, revision.diff, '      ')
1314
1317
        to_file.write('\n')
1315
1318
 
1316
1319