~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-12 20:36:40 UTC
  • mfrom: (2413 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2566.
  • Revision ID: john@arbash-meinel.com-20070412203640-z1jld315288moxvy
[merge] bzr.dev 2413

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
 
        old_name = '%s%s\t%s' % (old_label, path,
475
 
                                 _patch_header_date(old_tree, file_id, path))
 
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))
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):