Search in sources :

Example 1 with PatchSetInfo

use of com.google.gerrit.reviewdb.client.PatchSetInfo in project gerrit by GerritCodeReview.

the class PRED_commit_message_1 method exec.

@Override
public Operation exec(Prolog engine) throws PrologException {
    engine.setB0();
    Term a1 = arg1.dereference();
    PatchSetInfo psInfo = StoredValues.PATCH_SET_INFO.get(engine);
    SymbolTerm msg = SymbolTerm.create(psInfo.getMessage());
    if (!a1.unify(msg, engine.trail)) {
        return engine.fail();
    }
    return cont;
}
Also used : SymbolTerm(com.googlecode.prolog_cafe.lang.SymbolTerm) Term(com.googlecode.prolog_cafe.lang.Term) SymbolTerm(com.googlecode.prolog_cafe.lang.SymbolTerm) PatchSetInfo(com.google.gerrit.reviewdb.client.PatchSetInfo)

Example 2 with PatchSetInfo

use of com.google.gerrit.reviewdb.client.PatchSetInfo in project gerrit by GerritCodeReview.

the class PRED_commit_author_3 method exec.

@Override
public Operation exec(Prolog engine) throws PrologException {
    PatchSetInfo psInfo = StoredValues.PATCH_SET_INFO.get(engine);
    UserIdentity author = psInfo.getAuthor();
    return exec(engine, author);
}
Also used : UserIdentity(com.google.gerrit.reviewdb.client.UserIdentity) PatchSetInfo(com.google.gerrit.reviewdb.client.PatchSetInfo)

Example 3 with PatchSetInfo

use of com.google.gerrit.reviewdb.client.PatchSetInfo in project gerrit by GerritCodeReview.

the class PRED_commit_committer_3 method exec.

@Override
public Operation exec(Prolog engine) throws PrologException {
    PatchSetInfo psInfo = StoredValues.PATCH_SET_INFO.get(engine);
    UserIdentity committer = psInfo.getCommitter();
    return exec(engine, committer);
}
Also used : UserIdentity(com.google.gerrit.reviewdb.client.UserIdentity) PatchSetInfo(com.google.gerrit.reviewdb.client.PatchSetInfo)

Example 4 with PatchSetInfo

use of com.google.gerrit.reviewdb.client.PatchSetInfo in project gerrit by GerritCodeReview.

the class LabelNormalizerTest method setUpChange.

private void setUpChange() throws Exception {
    change = new Change(new Change.Key("Iabcd1234abcd1234abcd1234abcd1234abcd1234"), new Change.Id(1), userId, new Branch.NameKey(allProjects, "refs/heads/master"), TimeUtil.nowTs());
    PatchSetInfo ps = new PatchSetInfo(new PatchSet.Id(change.getId(), 1));
    ps.setSubject("Test change");
    change.setCurrentPatchSet(ps);
    db.changes().insert(ImmutableList.of(change));
}
Also used : PatchSet(com.google.gerrit.reviewdb.client.PatchSet) Change(com.google.gerrit.reviewdb.client.Change) LabelId(com.google.gerrit.reviewdb.client.LabelId) PatchSetInfo(com.google.gerrit.reviewdb.client.PatchSetInfo)

Example 5 with PatchSetInfo

use of com.google.gerrit.reviewdb.client.PatchSetInfo in project gerrit by GerritCodeReview.

the class PatchSetInfoFactory method get.

public PatchSetInfo get(RevWalk rw, RevCommit src, PatchSet.Id psi) throws IOException {
    rw.parseBody(src);
    PatchSetInfo info = new PatchSetInfo(psi);
    info.setSubject(src.getShortMessage());
    info.setMessage(src.getFullMessage());
    info.setAuthor(toUserIdentity(src.getAuthorIdent()));
    info.setCommitter(toUserIdentity(src.getCommitterIdent()));
    info.setRevId(src.getName());
    return info;
}
Also used : PatchSetInfo(com.google.gerrit.reviewdb.client.PatchSetInfo)

Aggregations

PatchSetInfo (com.google.gerrit.reviewdb.client.PatchSetInfo)7 PatchSet (com.google.gerrit.reviewdb.client.PatchSet)2 UserIdentity (com.google.gerrit.reviewdb.client.UserIdentity)2 Change (com.google.gerrit.reviewdb.client.Change)1 LabelId (com.google.gerrit.reviewdb.client.LabelId)1 SymbolTerm (com.googlecode.prolog_cafe.lang.SymbolTerm)1 Term (com.googlecode.prolog_cafe.lang.Term)1 IOException (java.io.IOException)1 Repository (org.eclipse.jgit.lib.Repository)1 RevCommit (org.eclipse.jgit.revwalk.RevCommit)1 RevWalk (org.eclipse.jgit.revwalk.RevWalk)1