~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/shelf_ui.py

  • Committer: Alexander Belchenko
  • Date: 2010-05-25 20:34:02 UTC
  • mto: (5258.1.1 diff-header-encoding)
  • mto: This revision was merged to the branch mainline in revision 5305.
  • Revision ID: bialix@ukr.net-20100525203402-vvq7m5t1erli5df7
using appropriate encoing for diff in shelve/unshelve.

Show diffs side-by-side

added added

removed removed

Lines of Context:
241
241
            new_tree = self.work_tree
242
242
        old_path = old_tree.id2path(file_id)
243
243
        new_path = new_tree.id2path(file_id)
244
 
        text_differ = diff.DiffText(old_tree, new_tree, diff_file)
 
244
        text_differ = diff.DiffText(old_tree, new_tree, diff_file,
 
245
            path_encoding=osutils.get_terminal_encoding())
245
246
        patch = text_differ.diff(file_id, old_path, new_path, 'file', 'file')
246
247
        diff_file.seek(0)
247
248
        return patches.parse_patch(diff_file)
497
498
        new_tree = tt.get_preview_tree()
498
499
        if self.write_diff_to is None:
499
500
            self.write_diff_to = ui.ui_factory.make_output_stream()
500
 
        diff.show_diff_trees(merger.this_tree, new_tree, self.write_diff_to)
 
501
        path_encoding = 'utf8'
 
502
        if sys.platform == 'win32':
 
503
            path_encoding = 'mbcs'
 
504
        diff.show_diff_trees(merger.this_tree, new_tree, self.write_diff_to,
 
505
            path_encoding=path_encoding)
501
506
        tt.finalize()
502
507
 
503
508
    def show_changes(self, merger):