/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/diff.py

  • Committer: Martin Pool
  • Date: 2005-08-01 20:25:24 UTC
  • Revision ID: mbp@sourcefrog.net-20050801202524-cc49f230ffa9c4e3
- correctly exclude root_directory from search for added files
  in compare_trees

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
    if not oldlines and not newlines:
43
43
        return
44
44
 
 
45
    nonl = False
 
46
 
 
47
    if oldlines and (oldlines[-1][-1] != '\n'):
 
48
        oldlines[-1] += '\n'
 
49
        nonl = True
 
50
    if newlines and (newlines[-1][-1] != '\n'):
 
51
        newlines[-1] += '\n'
 
52
        nonl = True
 
53
 
45
54
    ud = difflib.unified_diff(oldlines, newlines,
46
55
                              fromfile=old_label, tofile=new_label)
47
56
 
56
65
 
57
66
    for line in ud:
58
67
        to_file.write(line)
59
 
        if not line.endswith('\n'):
60
 
            to_file.write("\n\\ No newline at end of file\n")
 
68
    if nonl:
 
69
        print >>to_file, "\\ No newline at end of file"
61
70
    print >>to_file
62
71
 
63
72