~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/diff.py

  • Committer: Martin Pool
  • Date: 2005-07-13 00:30:30 UTC
  • Revision ID: mbp@sourcefrog.net-20050713003030-2e89871a9ce24c7b
- typo in testsweet

Show diffs side-by-side

added added

removed removed

Lines of Context:
389
389
 
390
390
    for file_id in old_tree:
391
391
        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
 
392
            kind = old_inv.get_file_kind(file_id)
 
393
            assert kind == new_inv.get_file_kind(file_id)
397
394
            
398
395
            assert kind in ('file', 'directory', 'symlink', 'root_directory'), \
399
396
                   'invalid file kind %r' % kind
401
398
            if kind == 'root_directory':
402
399
                continue
403
400
            
 
401
            old_path = old_inv.id2path(file_id)
 
402
            new_path = new_inv.id2path(file_id)
 
403
 
 
404
            old_ie = old_inv[file_id]
 
405
            new_ie = new_inv[file_id]
 
406
 
404
407
            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))):
 
408
                if (not is_inside_any(specific_files, old_path) 
 
409
                    and not is_inside_any(specific_files, new_path)):
407
410
                    continue
408
411
 
409
412
            if kind == 'file':
421
424
            
422
425
            if (old_ie.name != new_ie.name
423
426
                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,
 
427
                delta.renamed.append((old_path, new_path, file_id, kind,
427
428
                                      text_modified))
428
429
            elif text_modified:
429
 
                delta.modified.append((new_inv.id2path(file_id), file_id, kind))
 
430
                delta.modified.append((new_path, file_id, kind))
430
431
            elif want_unchanged:
431
 
                delta.unchanged.append((new_inv.id2path(file_id), file_id, kind))
 
432
                delta.unchanged.append((new_path, file_id, kind))
432
433
        else:
433
434
            kind = old_inv.get_file_kind(file_id)
434
435
            old_path = old_inv.id2path(file_id)