~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/diff.py

  • Committer: Robert Collins
  • Date: 2005-10-17 11:56:54 UTC
  • mfrom: (1185.16.59)
  • Revision ID: robertc@robertcollins.net-20051017115654-662239e1587524a8
mergeĀ fromĀ martin.

Show diffs side-by-side

added added

removed removed

Lines of Context:
167
167
    else:
168
168
        new_tree = b.revision_tree(revision2.in_history(b).rev_id)
169
169
 
170
 
    return show_diff_trees(old_tree, new_tree, output, specific_files,
171
 
                           external_diff_options)
 
170
    show_diff_trees(old_tree, new_tree, output, specific_files,
 
171
                    external_diff_options)
172
172
 
173
173
 
174
174
 
207
207
    delta = compare_trees(old_tree, new_tree, want_unchanged=False,
208
208
                          specific_files=specific_files)
209
209
 
210
 
    has_changes = 0
211
210
    for path, file_id, kind in delta.removed:
212
 
        has_changes = 1
213
211
        print >>to_file, '=== removed %s %r' % (kind, path)
214
212
        old_tree.inventory[file_id].diff(diff_file, old_label + path, old_tree,
215
213
                                         DEVNULL, None, None, to_file)
216
214
    for path, file_id, kind in delta.added:
217
 
        has_changes = 1
218
215
        print >>to_file, '=== added %s %r' % (kind, path)
219
216
        new_tree.inventory[file_id].diff(diff_file, new_label + path, new_tree,
220
217
                                         DEVNULL, None, None, to_file, 
221
218
                                         reverse=True)
222
219
    for (old_path, new_path, file_id, kind,
223
220
         text_modified, meta_modified) in delta.renamed:
224
 
        has_changes = 1
225
221
        prop_str = get_prop_change(meta_modified)
226
222
        print >>to_file, '=== renamed %s %r => %r%s' % (
227
223
                          kind, old_path, new_path, prop_str)
229
225
                                    new_label, new_path, new_tree,
230
226
                                    text_modified, kind, to_file, diff_file)
231
227
    for path, file_id, kind, text_modified, meta_modified in delta.modified:
232
 
        has_changes = 1
233
228
        prop_str = get_prop_change(meta_modified)
234
229
        print >>to_file, '=== modified %s %r%s' % (kind, path, prop_str)
235
230
        if text_modified:
236
231
            _maybe_diff_file_or_symlink(old_label, path, old_tree, file_id,
237
232
                                        new_label, path, new_tree,
238
233
                                        True, kind, to_file, diff_file)
239
 
    return has_changes
240
234
    
241
235
 
242
236
def get_prop_change(meta_modified):