Search in sources :

Example 1 with PatchType

use of com.google.gerrit.entities.Patch.PatchType in project gerrit by GerritCodeReview.

the class PatchListEntry method readFrom.

static PatchListEntry readFrom(InputStream in) throws IOException {
    ChangeType changeType = readEnum(in, ChangeType.values());
    PatchType patchType = readEnum(in, PatchType.values());
    String oldName = readString(in);
    String newName = readString(in);
    byte[] hdr = readBytes(in);
    int ins = readVarInt32(in);
    int del = readVarInt32(in);
    long size = readFixInt64(in);
    long sizeDelta = readFixInt64(in);
    Edit[] editArray = readEditArray(in);
    Edit[] editsDueToRebase = readEditArray(in);
    return new PatchListEntry(changeType, patchType, oldName, newName, hdr, ImmutableList.copyOf(editArray), ImmutableSet.copyOf(editsDueToRebase), ins, del, size, sizeDelta);
}
Also used : ChangeType(com.google.gerrit.entities.Patch.ChangeType) PatchType(com.google.gerrit.entities.Patch.PatchType) Edit(org.eclipse.jgit.diff.Edit) BasicSerialization.writeString(com.google.gerrit.server.ioutil.BasicSerialization.writeString) BasicSerialization.readString(com.google.gerrit.server.ioutil.BasicSerialization.readString)

Aggregations

ChangeType (com.google.gerrit.entities.Patch.ChangeType)1 PatchType (com.google.gerrit.entities.Patch.PatchType)1 BasicSerialization.readString (com.google.gerrit.server.ioutil.BasicSerialization.readString)1 BasicSerialization.writeString (com.google.gerrit.server.ioutil.BasicSerialization.writeString)1 Edit (org.eclipse.jgit.diff.Edit)1