~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/diff.py

  • Committer: ghigo
  • Date: 2007-08-17 17:44:15 UTC
  • mto: (2772.1.1 show-diff)
  • mto: This revision was merged to the branch mainline in revision 2773.
  • Revision ID: ghigo@venice-20070817174415-z9uufl65de5qhvqp
update on the basis of Aaron suggestions

Show diffs side-by-side

added added

removed removed

Lines of Context:
392
392
        If set, more Trees to use for looking up file ids
393
393
 
394
394
    path_encoding
395
 
        If set, the path will be encoded as specified
 
395
        If set, the path will be encoded as specified, otherwise is supposed
 
396
        to be utf8
396
397
    """
397
398
    old_tree.lock_read()
398
399
    try:
442
443
    for path, file_id, kind in delta.removed:
443
444
        has_changes = 1
444
445
        print >>to_file, "=== removed %s '%s'" % (kind,
445
 
                                                path.encode(path_encoding,
446
 
                                                            "replace"))
 
446
                                                  path.encode(path_encoding,
 
447
                                                              "replace"))
447
448
        old_name = '%s%s\t%s' % (old_label, path,
448
449
                                 _patch_header_date(old_tree, file_id, path))
449
450
        new_name = '%s%s\t%s' % (new_label, path, EPOCH_DATE)
451
452
                                         new_name, None, None, to_file)
452
453
    for path, file_id, kind in delta.added:
453
454
        has_changes = 1
454
 
        print >>to_file, "=== added %s '%s'" % (kind, path.encode(path_encoding,
455
 
                                                                "replace"))
 
455
        path_ = path.encode(path_encoding, "replace")
 
456
        print >>to_file, "=== added %s '%s'" % (kind, path_)
456
457
        old_name = '%s%s\t%s' % (old_label, path, EPOCH_DATE)
457
458
        new_name = '%s%s\t%s' % (new_label, path,
458
459
                                 _patch_header_date(new_tree, file_id, path))
463
464
         text_modified, meta_modified) in delta.renamed:
464
465
        has_changes = 1
465
466
        prop_str = get_prop_change(meta_modified)
466
 
        print >>to_file, "=== renamed %s '%s' => %r%s" % (
467
 
                    kind, old_path.encode(path_encoding, "replace"),
468
 
                    new_path.encode(path_encoding, "replace"), prop_str)
 
467
        oldpath_ = old_path.encode(path_encoding, "replace")
 
468
        newpath_ = new_path.encode(path_encoding, "replace"),
 
469
        print >>to_file, "=== renamed %s '%s' => %r%s" % (kind, oldpath_,
 
470
                                                          newpath_, prop_str)
469
471
        old_name = '%s%s\t%s' % (old_label, old_path,
470
472
                                 _patch_header_date(old_tree, file_id,
471
473
                                                    old_path))
478
480
    for path, file_id, kind, text_modified, meta_modified in delta.modified:
479
481
        has_changes = 1
480
482
        prop_str = get_prop_change(meta_modified)
481
 
        print >>to_file, "=== modified %s '%s'%s" % (kind,
482
 
                                                   path.encode(path_encoding,
483
 
                                                               "replace"),
484
 
                                                   prop_str)
 
483
        path_ = path.encode(path_encoding, "replace"),
 
484
        print >>to_file, "=== modified %s '%s'%s" % (kind, path_,
 
485
                                                     prop_str)
485
486
        # The file may be in a different location in the old tree (because
486
487
        # the containing dir was renamed, but the file itself was not)
487
488
        old_path = old_tree.id2path(file_id)