~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/diff.py

  • Committer: Martin Pool
  • Date: 2005-05-11 05:02:35 UTC
  • Revision ID: mbp@sourcefrog.net-20050511050235-173111e42687eaaf
- compare_trees() also reports unchanged files

Show diffs side-by-side

added added

removed removed

Lines of Context:
259
259
        (oldpath, newpath, id, text_modified)
260
260
    modified
261
261
        (path, id)
 
262
    unchanged
 
263
        (path, id)
262
264
 
263
265
    Each id is listed only once.
264
266
 
265
267
    Files that are both modified and renamed are listed only in
266
268
    renamed, with the text_modified flag true.
 
269
 
 
270
    The lists are normally sorted when the delta is created.
267
271
    """
268
272
    def __init__(self):
269
273
        self.added = []
270
274
        self.removed = []
271
275
        self.renamed = []
272
276
        self.modified = []
 
277
        self.unchanged = []
273
278
 
274
279
    def show(self, to_file, show_ids):
275
280
        if self.removed:
327
332
                delta.renamed.append((old_path, new_path, file_id, text_modified))
328
333
            elif text_modified:
329
334
                delta.modified.append((new_path, file_id))
 
335
            else:
 
336
                delta.unchanged.append((new_path, file_id))
330
337
        else:
331
338
            delta.removed.append((old_inv.id2path(file_id), file_id))
332
339
    for file_id in new_inv: