~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transform.py

  • Committer: Vincent Ladeuil
  • Date: 2007-07-15 11:24:18 UTC
  • mfrom: (2617 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2646.
  • Revision ID: v.ladeuil+lp@free.fr-20070715112418-9nn4n6esxv60ny4b
merge bzr.dev@1617

Show diffs side-by-side

added added

removed removed

Lines of Context:
717
717
    def _duplicate_entries(self, by_parent):
718
718
        """No directory may have two entries with the same name."""
719
719
        conflicts = []
 
720
        if (self._new_name, self._new_parent) == ({}, {}):
 
721
            return conflicts
720
722
        for children in by_parent.itervalues():
721
723
            name_ids = [(self.final_name(t), t) for t in children]
722
724
            name_ids.sort()
783
785
            return True
784
786
        return False
785
787
            
786
 
    def apply(self):
 
788
    def apply(self, no_conflicts=False):
787
789
        """Apply all changes to the inventory and filesystem.
788
790
        
789
791
        If filesystem or inventory conflicts are present, MalformedTransform
790
792
        will be thrown.
791
793
 
792
794
        If apply succeeds, finalize is not necessary.
 
795
 
 
796
        :param no_conflicts: if True, the caller guarantees there are no
 
797
            conflicts, so no check is made.
793
798
        """
794
 
        conflicts = self.find_conflicts()
795
 
        if len(conflicts) != 0:
796
 
            raise MalformedTransform(conflicts=conflicts)
 
799
        if not no_conflicts:
 
800
            conflicts = self.find_conflicts()
 
801
            if len(conflicts) != 0:
 
802
                raise MalformedTransform(conflicts=conflicts)
797
803
        inv = self._tree.inventory
798
804
        inventory_delta = []
799
805
        child_pb = bzrlib.ui.ui_factory.nested_progress_bar()