~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transform.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-11-11 08:45:19 UTC
  • mfrom: (4597.9.22 reports-conflict-resolved)
  • Revision ID: pqm@pqm.ubuntu.com-20101111084519-bmk1zmblp7kex41a
(vila) More feedback about the conflicts just resolved and the remaining
 ones. (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
703
703
        return conflicts
704
704
 
705
705
    def _parent_type_conflicts(self, by_parent):
706
 
        """Children must have a directory parent"""
 
706
        """parents must have directory 'contents'."""
707
707
        conflicts = []
708
708
        for parent_id, children in by_parent.iteritems():
709
709
            if parent_id is ROOT_PARENT:
710
710
                continue
711
 
            no_children = True
712
 
            for child_id in children:
713
 
                if self.final_kind(child_id) is not None:
714
 
                    no_children = False
715
 
                    break
716
 
            if no_children:
 
711
            if not self._any_contents(children):
717
712
                continue
718
 
            # There is at least a child, so we need an existing directory to
719
 
            # contain it.
720
713
            kind = self.final_kind(parent_id)
721
714
            if kind is None:
722
 
                # The directory will be deleted
723
715
                conflicts.append(('missing parent', parent_id))
724
716
            elif kind != "directory":
725
 
                # Meh, we need a *directory* to put something in it
726
717
                conflicts.append(('non-directory parent', parent_id))
727
718
        return conflicts
728
719
 
 
720
    def _any_contents(self, trans_ids):
 
721
        """Return true if any of the trans_ids, will have contents."""
 
722
        for trans_id in trans_ids:
 
723
            if self.final_kind(trans_id) is not None:
 
724
                return True
 
725
        return False
 
726
 
729
727
    def _set_executability(self, path, trans_id):
730
728
        """Set the executability of versioned files """
731
729
        if supports_executable():
822
820
        """
823
821
        orphans = []
824
822
        # Find the potential orphans, stop if one item should be kept
825
 
        for child_tid in self.by_parent()[dir_id]:
826
 
            if child_tid in self._removed_contents:
827
 
                # The child is removed as part of the transform. Since it was
828
 
                # versioned before, it's not an orphan
829
 
                continue
830
 
            elif self.final_file_id(child_tid) is None:
831
 
                # The child is not versioned
832
 
                orphans.append(child_tid)
 
823
        for c in self.by_parent()[dir_id]:
 
824
            if self.final_file_id(c) is None:
 
825
                orphans.append(c)
833
826
            else:
834
827
                # We have a versioned file here, searching for orphans is
835
828
                # meaningless.