public void updateConflicts(final @Nullable DiffEntry diff, int buffLimit) { if (hasConflicts) { if (diff != null) { conflictPathBuffer.add(diff.path()); } if (conflictPathBuffer.size() >= buffLimit) { Set<String> lookup = null; synchronized (conflictPathBuffer) { if (conflictPathBuffer.size() >= buffLimit) { lookup = new HashSet<>(conflictPathBuffer); conflictPathBuffer.clear(); } } if (lookup != null) { Set<String> matches = conflictsDb.findConflicts(null, lookup); if (!matches.isEmpty()) { conflictsCleanup.addAll(matches); } } } } }
public void addUnconflicted(DiffEntry diff) { TreeReport treeReport = parentReport(diff.path()); TYPE type = (diff.isAdd() ? diff.getNewObject() : diff.getOldObject()).getType(); if (TYPE.FEATURE == type) { treeReport.unconflictedFeatures.incrementAndGet(); } else { treeReport.unconflictedTrees.incrementAndGet(); } }
private List<String> findAffectedLayers(ObjectId leftRef, ObjectId rightRef, Context leftContext, Context rightContext) { List<DiffEntry> entries = command(FindChangedTrees.class)// .setOldTreeIsh(leftRef)// .setLeftSource(leftContext.objectDatabase())// .setNewTreeIsh(rightRef)// .setRightSource(rightContext.objectDatabase())// .call(); return entries.stream().map(e -> e.path()).collect(Collectors.toList()); }
final String treePath = treeDiff.path(); final IndexInfo indexInfo = indexInfosByFeatureTreeName.get(treePath); if (indexInfo == null) {
private void checkForFeatureTypeConflict(Optional<NodeRef> ancestorVersion, DiffEntry oursDiff, DiffEntry theirsDiff, MergeScenarioReport report) { final String path = oursDiff.path(); final boolean featureTypeConflict = !theirsDiff.getNewObject().getMetadataId() .equals(oursDiff.getNewObject().getMetadataId()); if (featureTypeConflict) { // In this case, we store the metadata id, not the element id ObjectId ancestorVersionId = ancestorVersion.isPresent() ? ancestorVersion.get().getMetadataId() : ObjectId.NULL; ObjectId ours = oursDiff.getNewObject().getMetadataId(); ObjectId theirs = theirsDiff.getNewObject().getMetadataId(); consumer.conflicted(new Conflict(path, ancestorVersionId, ours, theirs)); report.addConflict(path); } } }
final java.util.Optional<RevObject> oldObject = diffEntry.oldValue(); final java.util.Optional<RevObject> newObject = diffEntry.newValue(); final String path = diff.path();
final String path = oursDiff.path();
assertFalse(entry.isAdd()); assertFalse(entry.isChange()); assertEquals(nodeRef.path(), entry.path()); assertTrue(entry.isAdd()); assertFalse(entry.isChange()); assertEquals(nodeRef.path(), entry.path()); assertFalse(entry.isAdd()); assertTrue(entry.isChange()); assertEquals(nodeRef2.path(), entry.path());