~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:02:15 UTC
  • mto: This revision was merged to the branch mainline in revision 2408.
  • Revision ID: john@arbash-meinel.com-20070411220215-o07i1rcajpghkpom
Fix bug #103870 by passing None instead of a (sometimes wrong) 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()
474
477
        old_name = '%s%s\t%s' % (old_label, path,
475
 
                                 _patch_header_date(old_tree, file_id, path))
 
478
                                 _patch_header_date(old_tree, file_id, None))
476
479
        new_name = '%s%s\t%s' % (new_label, path,
477
480
                                 _patch_header_date(new_tree, file_id, path))
478
481
        if text_modified:
485
488
 
486
489
def _patch_header_date(tree, file_id, path):
487
490
    """Returns a timestamp suitable for use in a patch header."""
488
 
    return timestamp.format_patch_date(tree.get_file_mtime(file_id, path))
 
491
    mtime = tree.get_file_mtime(file_id, path)
 
492
    assert mtime is not None, \
 
493
        "got an mtime of None for file-id %s, path %s in tree %s" % (
 
494
                file_id, path, tree)
 
495
    return timestamp.format_patch_date(mtime)
489
496
 
490
497
 
491
498
def _raise_if_nonexistent(paths, old_tree, new_tree):