~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/diff.py

  • Committer: Martin Pool
  • Date: 2005-05-17 08:20:31 UTC
  • Revision ID: mbp@sourcefrog.net-20050517082031-802a4d121b6c87f0
- new utility TreeDelta.touches_file_id

Show diffs side-by-side

added added

removed removed

Lines of Context:
160
160
        self.modified = []
161
161
        self.unchanged = []
162
162
 
 
163
 
 
164
    def touches_file_id(self, file_id):
 
165
        """Return True if file_id is modified by this delta."""
 
166
        for l in self.added, self.removed, self.modified:
 
167
            for v in l:
 
168
                if v[1] == file_id:
 
169
                    return True
 
170
        for v in self.renamed:
 
171
            if v[2] == file_id:
 
172
                return True
 
173
        return False
 
174
            
 
175
 
163
176
    def show(self, to_file, show_ids=False, show_unchanged=False):
164
177
        def show_list(files):
165
178
            for path, fid, kind in files: