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

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

Add a whole subtree.

This implementation crawl down the whole subtree, adding
entries (subdirs, skipping the usual VC-specific control
directories such as ``.svn``, ``_darcs`` or ``CVS``, and
files).

Subclasses may use a better way, if the backend implements
a recursive add that skips the various metadata directories.

Definition at line 324 of file target.py.

00324                                  :
        """
        Add a whole subtree.

        This implementation crawl down the whole subtree, adding
        entries (subdirs, skipping the usual VC-specific control
        directories such as ``.svn``, ``_darcs`` or ``CVS``, and
        files).

        Subclasses may use a better way, if the backend implements
        a recursive add that skips the various metadata directories.
        """

        from os.path import join
        from os import walk
        from dualwd import IGNORED_METADIRS

        exclude = []

        if self.state_file.filename.startswith(self.basedir):
            sfrelname = self.state_file.filename[len(self.basedir)+1:]
            exclude.append(sfrelname)
            exclude.append(sfrelname+'.journal')

        if self.logfile.startswith(self.basedir):
            exclude.append(self.logfile[len(self.basedir)+1:])

        if subdir and subdir<>'.':
            self._addPathnames([subdir])

        for dir, subdirs, files in walk(join(self.basedir, subdir)):
            for excd in IGNORED_METADIRS:
                if excd in subdirs:
                    subdirs.remove(excd)

            for excf in exclude:
                if excf in files:
                    files.remove(excf)

            if subdirs or files:
                self._addPathnames([join(dir, df)[len(self.basedir)+1:]
                                    for df in subdirs + files])

    def _commit(self, date, author, patchname, changelog=None, entries=None):


Generated by  Doxygen 1.6.0   Back to index