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

def vcpx::cvsps::CvspsWorkingDir::__createParentCVSDirectories (   self,
  changeset,
  entry 
) [private]

Verify that the hierarchy down to the entry is under CVS.

If the directory containing the entry does not exist,
create it and make it appear as under CVS so that a subsequent
'cvs update' will work.

Definition at line 398 of file cvsps.py.

00398                                                             :
        """
        Verify that the hierarchy down to the entry is under CVS.

        If the directory containing the entry does not exist,
        create it and make it appear as under CVS so that a subsequent
        'cvs update' will work.
        """

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

        path = split(entry)[0]
        if path:
            basedir = join(self.basedir, path)
        else:
            basedir = self.basedir
        cvsarea = join(basedir, 'CVS')

        if path and not exists(cvsarea):
            parentcvs = self.__createParentCVSDirectories(changeset, path)

            assert exists(parentcvs), "Uhm, strange things happen: " \
                "unable to find or create parent CVS area for %r" % path

            if not exists(basedir):
                mkdir(basedir)

            # Create fake CVS area
            mkdir(cvsarea)

            # Create an empty "Entries" file
            entries = open(join(cvsarea, 'Entries'), 'w')
            entries.close()

            reposf = open(join(parentcvs, 'Repository'))
            rep = reposf.readline()[:-1]
            reposf.close()

            reposf = open(join(cvsarea, 'Repository'), 'w')
            reposf.write("%s/%s\n" % (rep, split(basedir)[1]))
            reposf.close()

            rootf = open(join(parentcvs, 'Root'))
            root = rootf.readline()
            rootf.close()

            rootf = open(join(cvsarea, 'Root'), 'w')
            rootf.write(root)
            rootf.close()

            # Add the "new" directory to the changeset, so that the
            # replayer gets its name

            entry = changeset.addEntry(path, None)
            entry.action_kind = entry.ADDED

        return cvsarea

    ## SyncronizableTargetWorkingDir


Generated by  Doxygen 1.6.0   Back to index