/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/shelf_ui.py

  • Committer: Jelmer Vernooij
  • Date: 2017-11-19 18:35:20 UTC
  • mfrom: (6809.4.27 swap-arguments)
  • Revision ID: jelmer@jelmer.uk-20171119183520-fmw89uw30e0tbhwz
Merge lp:~jelmer/brz/swap-arguments.

Show diffs side-by-side

added added

removed removed

Lines of Context:
231
231
            self.change_editor.finish()
232
232
        self.work_tree.unlock()
233
233
 
234
 
 
235
234
    def get_parsed_patch(self, file_id, invert=False):
236
235
        """Return a parsed version of a file's patch.
237
236
 
300
299
        :param file_id: The id of the file that was modified.
301
300
        :return: The number of changes.
302
301
        """
303
 
        work_tree_lines = self.work_tree.get_file_lines(file_id)
 
302
        path = self.work_tree.id2path(file_id)
 
303
        work_tree_lines = self.work_tree.get_file_lines(path, file_id)
304
304
        try:
305
305
            lines, change_count = self._select_hunks(creator, file_id,
306
306
                                                     work_tree_lines)
324
324
        if self.reporter.invert_diff:
325
325
            target_lines = work_tree_lines
326
326
        else:
327
 
            target_lines = self.target_tree.get_file_lines(file_id)
 
327
            path = self.target_tree.path2id(file_id)
 
328
            target_lines = self.target_tree.get_file_lines(path, file_id)
328
329
        textfile.check_text_lines(work_tree_lines)
329
330
        textfile.check_text_lines(target_lines)
330
331
        parsed = self.get_parsed_patch(file_id, self.reporter.invert_diff)
362
363
            content of the file, and change_region_count is the number of
363
364
            changed regions.
364
365
        """
365
 
        lines = osutils.split_lines(self.change_editor.edit_file(file_id))
 
366
        lines = osutils.split_lines(self.change_editor.edit_file(
 
367
            self.change_editor.old_tree.id2path(file_id),
 
368
            self.change_editor.new_tree.id2path(file_id),
 
369
            file_id=file_id))
366
370
        return lines, self._count_changed_regions(work_tree_lines, lines)
367
371
 
368
372
    @staticmethod