~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/diff.py

  • Committer: John Arbash Meinel
  • Date: 2007-04-11 22:05:16 UTC
  • mto: This revision was merged to the branch mainline in revision 2408.
  • Revision ID: john@arbash-meinel.com-20070411220516-bz4941rayeilvjac
Do a better fix, which recognizes that we should pass the correct old path.

Show diffs side-by-side

added added

removed removed

Lines of Context:
471
471
        has_changes = 1
472
472
        prop_str = get_prop_change(meta_modified)
473
473
        print >>to_file, '=== modified %s %r%s' % (kind, path.encode('utf8'), prop_str)
474
 
        # The path may not be correct in the case that the containing directory
475
 
        # was renamed. So don't pass it to _patch_header_date, which passes it
476
 
        # to tree.get_file_mtime()
477
 
        old_name = '%s%s\t%s' % (old_label, path,
478
 
                                 _patch_header_date(old_tree, file_id, None))
 
474
        # The file may be in a different location in the old tree (because
 
475
        # the containing dir was renamed, but the file itself was not)
 
476
        old_path = old_tree.id2path(file_id)
 
477
        old_name = '%s%s\t%s' % (old_label, old_path,
 
478
                                 _patch_header_date(old_tree, file_id, old_path))
479
479
        new_name = '%s%s\t%s' % (new_label, path,
480
480
                                 _patch_header_date(new_tree, file_id, path))
481
481
        if text_modified: