result = result && (hasSequence() == other.hasSequence()); if (hasSequence()) { result = result && (getSequence() == other.getSequence()); result = result && (hasSymref() == other.hasSymref()); if (hasSymref()) { result = result && getSymref() .equals(other.getSymref()); result = result && (hasTarget() == other.hasTarget()); if (hasTarget()) { result = result && getTarget() .equals(other.getTarget()); result = result && (hasIsPeeled() == other.hasIsPeeled()); if (hasIsPeeled()) { result = result && (getIsPeeled() == other.getIsPeeled()); result = result && (hasPeeled() == other.hasPeeled()); if (hasPeeled()) { result = result && getPeeled() .equals(other.getPeeled()); getUnknownFields().equals(other.getUnknownFields()); return result;
public org.eclipse.jgit.generated.storage.dht.proto.GitStore.RefData buildPartial() { org.eclipse.jgit.generated.storage.dht.proto.GitStore.RefData result = new org.eclipse.jgit.generated.storage.dht.proto.GitStore.RefData(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0;
public org.eclipse.jgit.generated.storage.dht.proto.GitStore.RefData buildPartial() { org.eclipse.jgit.generated.storage.dht.proto.GitStore.RefData result = new org.eclipse.jgit.generated.storage.dht.proto.GitStore.RefData(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0;
result = result && (hasSequence() == other.hasSequence()); if (hasSequence()) { result = result && (getSequence() == other.getSequence()); result = result && (hasSymref() == other.hasSymref()); if (hasSymref()) { result = result && getSymref() .equals(other.getSymref()); result = result && (hasTarget() == other.hasTarget()); if (hasTarget()) { result = result && getTarget() .equals(other.getTarget()); result = result && (hasIsPeeled() == other.hasIsPeeled()); if (hasIsPeeled()) { result = result && (getIsPeeled() == other.getIsPeeled()); result = result && (hasPeeled() == other.hasPeeled()); if (hasPeeled()) { result = result && getPeeled() .equals(other.getPeeled()); getUnknownFields().equals(other.getUnknownFields()); return result;
private DhtRef doPeel(final Ref leaf) throws MissingObjectException, IOException { RevWalk rw = new RevWalk(getRepository()); try { DhtReader ctx = (DhtReader) rw.getObjectReader(); RevObject obj = rw.parseAny(leaf.getObjectId()); RefData.Builder d = RefData.newBuilder(((DhtRef) leaf).getRefData()); ChunkKey oKey = ctx.findChunk(leaf.getObjectId()); if (oKey != null) d.getTargetBuilder().setChunkKey(oKey.asString()); else d.getTargetBuilder().clearChunkKey(); if (obj instanceof RevTag) { ObjectId pId = rw.peel(obj); d.getPeeledBuilder().setObjectName(pId.name()); ChunkKey pKey = ctx.findChunk(pId); if (pKey != null) d.getPeeledBuilder().setChunkKey(pKey.asString()); else d.getPeeledBuilder().clearChunkKey(); } else { d.clearPeeled(); } d.setIsPeeled(true); d.setSequence(d.getSequence() + 1); return new DhtObjectIdRef(leaf.getName(), d.build()); } finally { rw.release(); } }
private DhtRef doPeel(final Ref leaf) throws MissingObjectException, IOException { RevWalk rw = new RevWalk(getRepository()); try { DhtReader ctx = (DhtReader) rw.getObjectReader(); RevObject obj = rw.parseAny(leaf.getObjectId()); RefData.Builder d = RefData.newBuilder(((DhtRef) leaf).getRefData()); ChunkKey oKey = ctx.findChunk(leaf.getObjectId()); if (oKey != null) d.getTargetBuilder().setChunkKey(oKey.asString()); else d.getTargetBuilder().clearChunkKey(); if (obj instanceof RevTag) { ObjectId pId = rw.peel(obj); d.getPeeledBuilder().setObjectName(pId.name()); ChunkKey pKey = ctx.findChunk(pId); if (pKey != null) d.getPeeledBuilder().setChunkKey(pKey.asString()); else d.getPeeledBuilder().clearChunkKey(); } else { d.clearPeeled(); } d.setIsPeeled(true); d.setSequence(d.getSequence() + 1); return new DhtObjectIdRef(leaf.getName(), d.build()); } finally { rw.release(); } }
private RefData newData() throws IOException { RefData.Builder d = RefData.newBuilder(oldData); clearRefData(d); updateSequence(d); ObjectId newId = getNewObjectId(); d.getTargetBuilder().setObjectName(newId.name()); try { DhtReader ctx = (DhtReader) rw.getObjectReader(); RevObject obj = rw.parseAny(newId); ChunkKey oKey = ctx.findChunk(newId); if (oKey != null) d.getTargetBuilder().setChunkKey(oKey.asString()); if (obj instanceof RevTag) { ObjectId pId = rw.peel(obj); ChunkKey pKey = ctx.findChunk(pId); if (pKey != null) d.getPeeledBuilder().setChunkKey(pKey.asString()); d.getPeeledBuilder().setObjectName(pId.name()); } } catch (MissingObjectException e) { // Automatic peeling failed. Ignore the problem and deal with it // during reading later, this is the classical Git behavior on disk. } return d.build(); }
private RefData newData() throws IOException { RefData.Builder d = RefData.newBuilder(oldData); clearRefData(d); updateSequence(d); ObjectId newId = getNewObjectId(); d.getTargetBuilder().setObjectName(newId.name()); try { DhtReader ctx = (DhtReader) rw.getObjectReader(); RevObject obj = rw.parseAny(newId); ChunkKey oKey = ctx.findChunk(newId); if (oKey != null) d.getTargetBuilder().setChunkKey(oKey.asString()); if (obj instanceof RevTag) { ObjectId pId = rw.peel(obj); ChunkKey pKey = ctx.findChunk(pId); if (pKey != null) d.getPeeledBuilder().setChunkKey(pKey.asString()); d.getPeeledBuilder().setObjectName(pId.name()); } } catch (MissingObjectException e) { // Automatic peeling failed. Ignore the problem and deal with it // during reading later, this is the classical Git behavior on disk. } return d.build(); }
@java.lang.Override public int hashCode() { int hash = 41; hash = (19 * hash) + getDescriptorForType().hashCode(); if (hasSequence()) { hash = (37 * hash) + SEQUENCE_FIELD_NUMBER; hash = (53 * hash) + getSequence(); } if (hasSymref()) { hash = (37 * hash) + SYMREF_FIELD_NUMBER; hash = (53 * hash) + getSymref().hashCode(); } if (hasTarget()) { hash = (37 * hash) + TARGET_FIELD_NUMBER; hash = (53 * hash) + getTarget().hashCode(); } if (hasIsPeeled()) { hash = (37 * hash) + IS_PEELED_FIELD_NUMBER; hash = (53 * hash) + hashBoolean(getIsPeeled()); } if (hasPeeled()) { hash = (37 * hash) + PEELED_FIELD_NUMBER; hash = (53 * hash) + getPeeled().hashCode(); } hash = (29 * hash) + getUnknownFields().hashCode(); return hash; }
@java.lang.Override public int hashCode() { int hash = 41; hash = (19 * hash) + getDescriptorForType().hashCode(); if (hasSequence()) { hash = (37 * hash) + SEQUENCE_FIELD_NUMBER; hash = (53 * hash) + getSequence(); } if (hasSymref()) { hash = (37 * hash) + SYMREF_FIELD_NUMBER; hash = (53 * hash) + getSymref().hashCode(); } if (hasTarget()) { hash = (37 * hash) + TARGET_FIELD_NUMBER; hash = (53 * hash) + getTarget().hashCode(); } if (hasIsPeeled()) { hash = (37 * hash) + IS_PEELED_FIELD_NUMBER; hash = (53 * hash) + hashBoolean(getIsPeeled()); } if (hasPeeled()) { hash = (37 * hash) + PEELED_FIELD_NUMBER; hash = (53 * hash) + getPeeled().hashCode(); } hash = (29 * hash) + getUnknownFields().hashCode(); return hash; }
@Override public DhtRefUpdate newUpdate(String refName, boolean detach) throws IOException { boolean detachingSymbolicRef = false; DhtRef ref = getOneRef(refName); if (ref == null) ref = new DhtObjectIdRef(refName, NONE); else detachingSymbolicRef = detach && ref.isSymbolic(); if (detachingSymbolicRef) { RefData src = ((DhtRef) ref.getLeaf()).getRefData(); RefData.Builder b = RefData.newBuilder(ref.getRefData()); b.clearSymref(); b.setTarget(src.getTarget()); ref = new DhtObjectIdRef(refName, b.build()); } RepositoryKey repo = repository.getRepositoryKey(); DhtRefUpdate update = new DhtRefUpdate(this, repo, db, ref); if (detachingSymbolicRef) update.setDetachingSymbolicRef(); return update; }
@Override protected Result doLink(String target) throws IOException { try { RefData.Builder d = RefData.newBuilder(oldData); clearRefData(d); updateSequence(d); d.setSymref(target); newData = d.build(); boolean r = db.ref().compareAndPut(refKey, oldData, newData); if (r) { getRefDatabase().stored(dstRef.getName(), newData); if (getRef().getStorage() == Ref.Storage.NEW) return Result.NEW; return Result.FORCED; } else { getRefDatabase().clearCache(); return Result.LOCK_FAILURE; } } catch (TimeoutException e) { return Result.IO_FAILURE; } }
@Override protected Result doLink(String target) throws IOException { try { RefData.Builder d = RefData.newBuilder(oldData); clearRefData(d); updateSequence(d); d.setSymref(target); newData = d.build(); boolean r = db.ref().compareAndPut(refKey, oldData, newData); if (r) { getRefDatabase().stored(dstRef.getName(), newData); if (getRef().getStorage() == Ref.Storage.NEW) return Result.NEW; return Result.FORCED; } else { getRefDatabase().clearCache(); return Result.LOCK_FAILURE; } } catch (TimeoutException e) { return Result.IO_FAILURE; } }
public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; if (!hasSequence()) { memoizedIsInitialized = 0; return false; } if (hasTarget()) { if (!getTarget().isInitialized()) { memoizedIsInitialized = 0; return false; } } if (hasPeeled()) { if (!getPeeled().isInitialized()) { memoizedIsInitialized = 0; return false; } } memoizedIsInitialized = 1; return true; }
@Override public DhtRefUpdate newUpdate(String refName, boolean detach) throws IOException { boolean detachingSymbolicRef = false; DhtRef ref = getOneRef(refName); if (ref == null) ref = new DhtObjectIdRef(refName, NONE); else detachingSymbolicRef = detach && ref.isSymbolic(); if (detachingSymbolicRef) { RefData src = ((DhtRef) ref.getLeaf()).getRefData(); RefData.Builder b = RefData.newBuilder(ref.getRefData()); b.clearSymref(); b.setTarget(src.getTarget()); ref = new DhtObjectIdRef(refName, b.build()); } RepositoryKey repo = repository.getRepositoryKey(); DhtRefUpdate update = new DhtRefUpdate(this, repo, db, ref); if (detachingSymbolicRef) update.setDetachingSymbolicRef(); return update; }
public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; if (!hasSequence()) { memoizedIsInitialized = 0; return false; } if (hasTarget()) { if (!getTarget().isInitialized()) { memoizedIsInitialized = 0; return false; } } if (hasPeeled()) { if (!getPeeled().isInitialized()) { memoizedIsInitialized = 0; return false; } } memoizedIsInitialized = 1; return true; }
public Builder mergeFrom(org.eclipse.jgit.generated.storage.dht.proto.GitStore.RefData other) { if (other == org.eclipse.jgit.generated.storage.dht.proto.GitStore.RefData.getDefaultInstance()) return this; if (other.hasSequence()) { setSequence(other.getSequence()); } if (other.hasSymref()) { setSymref(other.getSymref()); } if (other.hasTarget()) { mergeTarget(other.getTarget()); } if (other.hasIsPeeled()) { setIsPeeled(other.getIsPeeled()); } if (other.hasPeeled()) { mergePeeled(other.getPeeled()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
public Builder toBuilder() { return newBuilder(this); }
public Builder mergeFrom(org.eclipse.jgit.generated.storage.dht.proto.GitStore.RefData other) { if (other == org.eclipse.jgit.generated.storage.dht.proto.GitStore.RefData.getDefaultInstance()) return this; if (other.hasSequence()) { setSequence(other.getSequence()); } if (other.hasSymref()) { setSymref(other.getSymref()); } if (other.hasTarget()) { mergeTarget(other.getTarget()); } if (other.hasIsPeeled()) { setIsPeeled(other.getIsPeeled()); } if (other.hasPeeled()) { mergePeeled(other.getPeeled()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
public Builder toBuilder() { return newBuilder(this); }