~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transform.py

Fixed overwrites

Show diffs side-by-side

added added

removed removed

Lines of Context:
420
420
        conflicts.extend(self._parent_type_conflicts(by_parent))
421
421
        conflicts.extend(self._improper_versioning())
422
422
        conflicts.extend(self._executability_conflicts())
 
423
        conflicts.extend(self._overwrite_conflicts())
423
424
        return conflicts
424
425
 
425
426
    def _add_tree_children(self):
528
529
                    conflicts.append(('non-file executability', trans_id))
529
530
        return conflicts
530
531
 
 
532
    def _overwrite_conflicts(self):
 
533
        """Check for overwrites (not permitted on Win32)"""
 
534
        conflicts = []
 
535
        for trans_id in self._new_contents:
 
536
            try:
 
537
                self.tree_kind(trans_id)
 
538
            except NoSuchFile:
 
539
                continue
 
540
            if trans_id not in self._removed_contents:
 
541
                conflicts.append(('overwrite', trans_id,
 
542
                                 self.final_name(trans_id)))
 
543
        return conflicts
 
544
 
531
545
    def _duplicate_entries(self, by_parent):
532
546
        """No directory may have two entries with the same name."""
533
547
        conflicts = []