~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/diff.py

  • Committer: Martin Pool
  • Date: 2005-06-27 01:36:22 UTC
  • Revision ID: mbp@sourcefrog.net-20050627013622-0d56be3e3105043e
Merge from aaron:

------------------------------------------------------------
revno: 763
committer: Aaron Bentley <abentley@panoramicfeedback.com>
timestamp: Thu 2005-06-23 17:30:28 -0400
message:
  Copy files in immutable stores directly.
------------------------------------------------------------
revno: 762
committer: Aaron Bentley <abentley@panoramicfeedback.com>
timestamp: Thu 2005-06-23 16:12:33 -0400
message:
  Fixed direct call of get_url in RemoteBranch.get_revision
------------------------------------------------------------
revno: 761
committer: Aaron Bentley <abentley@panoramicfeedback.com>
timestamp: Thu 2005-06-23 12:00:31 -0400
message:
  Added prefetch support to update_revisions
------------------------------------------------------------
revno: 760
committer: Aaron Bentley <abentley@panoramicfeedback.com>
timestamp: Thu 2005-06-23 11:57:54 -0400
message:
  Added cache support to branch and pull
------------------------------------------------------------
revno: 759
committer: Aaron Bentley <abentley@panoramicfeedback.com>
timestamp: Thu 2005-06-23 11:21:37 -0400
message:
  Added find_cached_branch to branch
------------------------------------------------------------
revno: 758
committer: Aaron Bentley <abentley@panoramicfeedback.com>
timestamp: Thu 2005-06-23 11:17:10 -0400
message:
  Added CachedStore type to reduce remote downloads

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
        ud = list(ud)
64
64
        ud[2] = ud[2].replace('+1,0', '+0,0')
65
65
 
66
 
    for line in ud:
67
 
        to_file.write(line)
 
66
    to_file.writelines(ud)
68
67
    if nonl:
69
68
        print >>to_file, "\\ No newline at end of file"
70
69
    print >>to_file
389
388
 
390
389
    for file_id in old_tree:
391
390
        if file_id in new_tree:
392
 
            old_ie = old_inv[file_id]
393
 
            new_ie = new_inv[file_id]
394
 
 
395
 
            kind = old_ie.kind
396
 
            assert kind == new_ie.kind
 
391
            kind = old_inv.get_file_kind(file_id)
 
392
            assert kind == new_inv.get_file_kind(file_id)
397
393
            
398
394
            assert kind in ('file', 'directory', 'symlink', 'root_directory'), \
399
395
                   'invalid file kind %r' % kind
401
397
            if kind == 'root_directory':
402
398
                continue
403
399
            
 
400
            old_path = old_inv.id2path(file_id)
 
401
            new_path = new_inv.id2path(file_id)
 
402
 
 
403
            old_ie = old_inv[file_id]
 
404
            new_ie = new_inv[file_id]
 
405
 
404
406
            if specific_files:
405
 
                if (not is_inside_any(specific_files, old_inv.id2path(file_id)) 
406
 
                    and not is_inside_any(specific_files, new_inv.id2path(file_id))):
 
407
                if (not is_inside_any(specific_files, old_path) 
 
408
                    and not is_inside_any(specific_files, new_path)):
407
409
                    continue
408
410
 
409
411
            if kind == 'file':
421
423
            
422
424
            if (old_ie.name != new_ie.name
423
425
                or old_ie.parent_id != new_ie.parent_id):
424
 
                delta.renamed.append((old_inv.id2path(file_id),
425
 
                                      new_inv.id2path(file_id),
426
 
                                      file_id, kind,
 
426
                delta.renamed.append((old_path, new_path, file_id, kind,
427
427
                                      text_modified))
428
428
            elif text_modified:
429
 
                delta.modified.append((new_inv.id2path(file_id), file_id, kind))
 
429
                delta.modified.append((new_path, file_id, kind))
430
430
            elif want_unchanged:
431
 
                delta.unchanged.append((new_inv.id2path(file_id), file_id, kind))
 
431
                delta.unchanged.append((new_path, file_id, kind))
432
432
        else:
433
433
            kind = old_inv.get_file_kind(file_id)
434
434
            old_path = old_inv.id2path(file_id)