@Override public void pushNewData(Repository local, Ref ref, String refspec, ProgressListener progress) throws SynchronizationException { Optional<Ref> remoteRef = getRemoteRef(refspec); checkPush(local, ref, remoteRef); beginPush(); PushCommitGatherer gatherer = new PushCommitGatherer(local); gatherer.traverse(ref.getObjectId()); Stack<ObjectId> needed = gatherer.commits; while (!needed.isEmpty()) { ObjectId commitToPush = needed.pop(); pushSparseCommit(local, commitToPush); } ObjectId newCommitId = local.graphDatabase().getMapping(ref.getObjectId()); ObjectId originalRemoteRefValue = ObjectId.NULL; if (remoteRef.isPresent()) { originalRemoteRefValue = remoteRef.get().getObjectId(); } endPush(refspec, newCommitId, originalRemoteRefValue.toString()); }
@Override public final void fetchNewData(Repository local, Ref ref, Optional<Integer> fetchLimit, ProgressListener progress) { Preconditions.checkState(!fetchLimit.isPresent(), "A sparse clone cannot be shallow."); FetchCommitGatherer gatherer = new FetchCommitGatherer(getRemoteWrapper(), local); gatherer.traverse(ref.getObjectId()); Stack<ObjectId> needed = gatherer.commits; while (!needed.empty()) { ObjectId commitId = needed.pop(); // If the last commit is empty, add it anyways to preserve parentage of new commits. boolean allowEmpty = needed.isEmpty(); fetchSparseCommit(local, commitId, allowEmpty); } }
@Override public void pushNewData(Repository local, Ref ref, ProgressListener progress) throws SynchronizationException { pushNewData(local, ref, ref.getName(), progress); }
final boolean allowEmpty) { Optional<RevObject> object = getObject(commitId); if (object.isPresent() && object.get().getType().equals(TYPE.COMMIT)) { RevCommit commit = (RevCommit) object.get(); try (FilteredDiffIterator changes = getFilteredChanges(local, commit)) { GraphDatabase graphDatabase = local.graphDatabase(); ObjectStore objectDatabase = local.objectDatabase();
final boolean allowEmpty) { Optional<RevObject> object = getObject(commitId); if (object.isPresent() && object.get().getType().equals(TYPE.COMMIT)) { RevCommit commit = (RevCommit) object.get(); try (FilteredDiffIterator changes = getFilteredChanges(local, commit)) { GraphDatabase graphDatabase = local.graphDatabase(); ObjectStore objectDatabase = local.objectDatabase();
@Override public void pushNewData(Repository local, Ref ref, String refspec, ProgressListener progress) throws SynchronizationException { Optional<Ref> remoteRef = getRemoteRef(refspec); checkPush(local, ref, remoteRef); beginPush(); PushCommitGatherer gatherer = new PushCommitGatherer(local); try { gatherer.traverse(ref.getObjectId()); Stack<ObjectId> needed = gatherer.commits; while (!needed.isEmpty()) { ObjectId commitToPush = needed.pop(); pushSparseCommit(local, commitToPush); } ObjectId newCommitId = local.graphDatabase().getMapping(ref.getObjectId()); ObjectId originalRemoteRefValue = ObjectId.NULL; if (remoteRef.isPresent()) { originalRemoteRefValue = remoteRef.get().getObjectId(); } endPush(refspec, newCommitId, originalRemoteRefValue.toString()); } catch (Exception e) { Throwables.propagate(e); } finally { } }
@Override public final void fetchNewData(Repository local, Ref ref, Optional<Integer> fetchLimit, ProgressListener progress) { Preconditions.checkState(!fetchLimit.isPresent(), "A sparse clone cannot be shallow."); FetchCommitGatherer gatherer = new FetchCommitGatherer(getRemoteWrapper(), local); try { gatherer.traverse(ref.getObjectId()); Stack<ObjectId> needed = gatherer.commits; while (!needed.empty()) { ObjectId commitId = needed.pop(); // If the last commit is empty, add it anyways to preserve parentage of new commits. boolean allowEmpty = needed.isEmpty(); fetchSparseCommit(local, commitId, allowEmpty); } } catch (Exception e) { Throwables.propagate(e); } finally { } }
@Override public void pushNewData(Repository local, Ref ref, ProgressListener progress) throws SynchronizationException { pushNewData(local, ref, ref.getName(), progress); }