~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree.py

  • Committer: Aaron Bentley
  • Date: 2005-10-01 06:48:01 UTC
  • mto: (1185.12.13)
  • mto: This revision was merged to the branch mainline in revision 1419.
  • Revision ID: aaron.bentley@utoronto.ca-20051001064801-7400c2ed0fe26080
Made iter_conflicts a WorkingTree method

Show diffs side-by-side

added added

removed removed

Lines of Context:
196
196
            if not self.is_ignored(subp):
197
197
                yield subp
198
198
 
 
199
    def iter_conflicts(self):
 
200
        conflicted = set()
 
201
        for path in (s[0] for s in self.list_files()):
 
202
            stem = get_conflicted_stem(path)
 
203
            if stem is None:
 
204
                continue
 
205
            if stem not in conflicted:
 
206
                conflicted.add(stem)
 
207
                yield stem
199
208
 
200
209
    def extras(self):
201
210
        """Yield all unknown files in this WorkingTree.
287
296
                    return pat
288
297
        else:
289
298
            return None
290
 
        
 
299
 
 
300
CONFLICT_SUFFIXES = ('.THIS', '.BASE', '.OTHER')
 
301
def get_conflicted_stem(path):
 
302
    for suffix in CONFLICT_SUFFIXES:
 
303
        if path.endswith(suffix):
 
304
            return path[:-len(suffix)]