def fetchProject(self): self.mLockProject.acquire() length = len(self.mListProject) if self.mErrorCount == 0 and length > 0: node = self.mListProject.pop(0) else: node = None self.mLockProject.release() if not node: return 0 relPath = self.getProjectRelPath(node) srcPath = self.getAbsPath(relPath) destPath = os.path.join(self.mPathProjects, relPath + ".git") relDestPath = self.getRelPath(destPath) relDestPath = os.path.join(self.getRelRoot(relPath), relDestPath) manager = GitSvnManager(srcPath, self.mVerbose) manager.doRecovery(destPath) iResult = self.fetchProjectBase(manager, node[0]) if iResult < 1: return iResult if not manager.isInitialized(): self.mListEmpty.append(node) return iResult if not manager.doBackup(destPath): return -1 return iResult
def doRecovery(self): if not self.loadManifest(): return False self.mListProject = self.mManifest.getProjects() if self.mListProject == None: return False if not self.mVerbose: self.initProgress(len(self.mListProject)) for node in self.mManifest.getProjects(): relPath = self.getProjectRelPath(node) srcPath = self.getAbsPath(relPath) destPath = os.path.join(self.mPathProjects, relPath + ".git") manager = GitSvnManager(srcPath, self.mVerbose) if not manager.doRecovery(destPath): return False if not self.mVerbose: self.addProgress() if not self.mVerbose: self.finishProgress() return True