def source(self): returnCommits = [] if not self.config.getboolean('Git', 'External', fallback=False): return returnCommits for confSect in list(self.config.branches.values()): branch = confSect.name tmpDir = TemporaryDirectory() self.tmpDirs.append(tmpDir) source = self.config.repoPath cloneSource = source dbLog = filterOnStatusBase( "external", filterOnSource(source, self.dbBe.getAllCommits())) dbLog = sorted(dbLog, key=lambda commit: commit.date) with SSHEnvironment(cloneSource, self.config) as sshCloneSource: if not sshCloneSource is None: cloneSource = sshCloneSource try: returnCommits += self._doClone(source, cloneSource, branch, tmpDir.name, dbLog) except CalledProcessError as err: syslog( LOG_WARNING, "CalledProcessError for branch '%s' in '%s': '%s'" % (branch, source, err)) return returnCommits
def source(self): returnCommits = [] if not self.config.getboolean('Git', 'External', fallback=False): return returnCommits for confSect in self.config.branches.values(): branch = confSect.name tmpDir = TemporaryDirectory() self.tmpDirs.append(tmpDir) source = self.config.repoPath cloneSource = source dbLog = filterOnStatusBase("external", filterOnSource(source, self.dbBe.getAllCommits())) dbLog = sorted(dbLog, key=lambda commit: commit.date) with SSHEnvironment(cloneSource, self.config) as sshCloneSource: if not sshCloneSource is None: cloneSource = sshCloneSource try: returnCommits += self._doClone(source, cloneSource, branch, tmpDir.name, dbLog) except CalledProcessError as err: syslog(LOG_WARNING, "CalledProcessError for branch '%s' in '%s': '%s'"% (branch, source, err)) return returnCommits
def store(self, commits): commits = gitdhutils.filterOnStatusBase('databaselog', commits) gitdhutils.mInsertCommit(self.dbBe, commits)
def store(self, commits): mInsertCommit(self.dbBe, filterOnStatusBase('external', commits))