public PatchSetInfo get(Project.NameKey project, PatchSet patchSet)
     throws PatchSetInfoNotAvailableException {
   try (Repository repo = repoManager.openRepository(project);
       RevWalk rw = new RevWalk(repo)) {
     final RevCommit src = rw.parseCommit(ObjectId.fromString(patchSet.getRevision().get()));
     PatchSetInfo info = get(rw, src, patchSet.getId());
     info.setParents(toParentInfos(src.getParents(), rw));
     return info;
   } catch (IOException e) {
     throw new PatchSetInfoNotAvailableException(e);
   }
 }
  @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;
  }
 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;
 }