コード例 #1
0
    def log(project_id, number):
        # Load project from internal database
        project = models.Project.query.filter_by(id=project_id).first()

        # Init git wrap
        gitWrap = GitWrap(project.repository, config.REPOSITORIES)
        gitWrap.init()

        return ValidationResult([CommitWrap(n).getVars() for n in gitWrap.log(number)])
コード例 #2
0
    def getRevisionDifference(repository, prevRevision, revision):
        # Init git wrap
        gitWrap = GitWrap(repository, config.REPOSITORIES)
        gitWrap.init()
        
        # Get commit changes
        patch = gitWrap.get_commit_diff(prevRevision, revision)

        # Parse patch
        return ValidationResult(Parser.run(patch).getVars())
コード例 #3
0
    def exists(project_id):
        # Load project from internal database
        project = models.Project.query.filter_by(id=project_id).first()

        # Init git wrap
        gitWrap = GitWrap(project.repository, config.REPOSITORIES)
        result = { "exists" : gitWrap.init() }

        # Init validation
        return ValidationResult(result)
コード例 #4
0
    def getCommitByRepository(repository, prevRevision, revision):
        # Init git wrap
        gitWrap = GitWrap(repository, config.REPOSITORIES)
        gitWrap.init()

        # Load commit
        commit = gitWrap.get_commit(revision)
        commitWrap = CommitWrap(commit)

        # Get commit changes
        commitWrap.diff = RepositoryService.getRevisionDifference(repository, prevRevision, revision).data; 
       
        # Return result
        return ValidationResult(commitWrap.getVars())