Logo Search packages:      
Sourcecode: tailor version File versions  Download package

def vcpx::target::SyncronizableTargetWorkingDir::_replayChangeset (   self,
) [private]

Replicate the actions performed by the changeset on the tree of

Definition at line 260 of file target.py.

00260                                          :
        Replicate the actions performed by the changeset on the tree of

        from os.path import join, isdir

        added = changeset.addedEntries()
        renamed = changeset.renamedEntries()
        removed = changeset.removedEntries()

        # Sort added entries, to be sure that /root/addedDir/ comes
        # before /root/addedDir/addedSubdir
        added.sort(lambda x,y: cmp(x.name, y.name))

        # Sort removes in reverse order, to delete directories after
        # their contents.
        removed.sort(lambda x,y: cmp(y.name, x.name))

        # Replay the actions

        if renamed and removed:
            # Handle the "replace" operation, that is a remove+rename

            renames = [e.name for e in renamed]
            removesfirst = []
            for rem in removed:
                if rem.name in renames:

            if removesfirst:
                for rem in removesfirst:

        if renamed: self._renameEntries(renamed)
        if removed: self._removeEntries(removed)
        if added: self._addEntries(added)

        # Finally, deal with "copied" directories. The simple way is
        # executing an _addSubtree on each of them, evenif this may
        # cause "warnings" on items just moved/added above...

        while added:
            subdir = added.pop(0).name
            if isdir(join(self.basedir, subdir)):
                added = [e for e in added if not e.name.startswith(subdir)]

    def _addEntries(self, entries):

Generated by  Doxygen 1.6.0   Back to index