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

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

Rename a sequence of entries, adding all the parent directories
of each entry.

Definition at line 388 of file target.py.

00388                                      :
        """
        Rename a sequence of entries, adding all the parent directories
        of each entry.
        """

        from os import rename
        from os.path import split, join, exists

        added = []
        for e in entries:
            parents = []
            parent = split(e.name)[0]
            while parent:
                if not parent in added:
                    parents.append(parent)
                    added.append(parent)
                parent = split(parent)[0]
            if parents:
                parents.reverse()
                self._addPathnames(parents)

            # Check to see if the oldentry is still there. If it is,
            # that probably means one thing: it's been moved and then
            # replaced, see svn 'R' event. In this case, rename the
            # existing old entry to something else to trick targets
            # (that will assume the move was already done manually) and
            # finally restore its name.

            absold = join(self.basedir, e.old_name)
            renamed = exists(absold)
            if renamed:
                rename(absold, absold + '-TAILOR-HACKED-TEMP-NAME')
            try:
                self._renamePathname(e.old_name, e.name)
            finally:
                if renamed:
                    rename(absold + '-TAILOR-HACKED-TEMP-NAME', absold)

    def _renamePathname(self, oldname, newname):


Generated by  Doxygen 1.6.0   Back to index