/* CVS Recursion processor Copyright (C) 2004 Tony Hoyle and March-Hare Software Ltd This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #define NO_REDIRECTION #include "cvs.h" #include "RecurseRepository.h" #include "Modules1.h" #include "Modules2.h" CRecurseRepository::CRecurseRepository() { } CRecurseRepository::~CRecurseRepository() { } // Start the recursion // Module may be a directory or a file, and will be correct // only from the users' point of view. bool CRecurseRepository::BeginRecursion(const char *module) { typedef std::vector dirlist_t; dirlist_t dirlist; CvsBasicEntry first; CModules1 mod1; CModules2 mod2; mod1.ReadModules1(); mod2.ReadModules2(); first.logical_name=module; first.physical_name=module; dirlist.push_back(first); for(size_t i=0; i& list) { CDirectoryAccess dir; DirectoryAccessInfo inf; if(!dir.open(item.physical_name.c_str())) { CServerIo::trace(3,"Physical directory '%s' does not exist",item.physical_name.c_str()); return; } while(dir.next(inf)) { if(!inf.isdir) continue; // Handle islink here like a separate mapping possibly CvsBasicEntry ent; cvs::sprintf(ent.logical_name,256,"%s/%s",item.logical_name.c_str(),"/",inf.filename.c_str()); cvs::sprintf(ent.physical_name,256,"%s/%s",item.physical_name.c_str(),"/",inf.filename.c_str()); list.push_back(ent); } }