/** * @param pathFilter the path filter for the conflicts * @return the conflicts that match the path filter, if no path filter is specified, all * conflicts will be returned */ @Override public Iterator<Conflict> getConflicted(@Nullable String pathFilter) { return conflictsDb.getByPrefix(null, pathFilter); }
/** * @param pathFilter the path filter for the conflicts * @return the conflicts that match the path filter, if no path filter is specified, all * conflicts will be returned */ @Override public Iterator<Conflict> getConflicted(@Nullable String pathFilter) { return conflictsDb.getByPrefix(null, pathFilter); }
@Override public Iterator<Conflict> getByPrefix(@Nullable String namespace, @Nullable String prefixFilter) { return database.getByPrefix(txNamespace, prefixFilter); }
@Override public Iterator<Conflict> getByPrefix(@Nullable String namespace, @Nullable String prefixFilter) { return database.getByPrefix(txNamespace, prefixFilter); }
@Override public Iterator<Conflict> getConflicted(@Nullable String pathFilter) { return conflictsDatabase().getByPrefix(null, pathFilter); }
@Override public Iterator<Conflict> getConflicted(@Nullable String pathFilter) { return conflictsDatabase().getByPrefix(null, pathFilter); }
private CheckoutException buildConflictsException(final ConflictsDatabase conflictsDatabase) { final long conflictCount = conflictsDatabase.getCountByPrefix(null, null); Iterator<Conflict> conflicts = Iterators .limit(conflictsDatabase.getByPrefix(branchOrCommit, null), 25); StringBuilder msg = new StringBuilder(); while (conflicts.hasNext()) { Conflict conflict = conflicts.next(); msg.append("error: " + conflict.getPath() + " needs merge.\n"); } if (conflictCount > 25) { msg.append(String.format("and %,d more.\n", (conflictCount - 25))); } msg.append("You need to resolve your index first.\n"); return new CheckoutException(msg.toString(), StatusCode.UNMERGED_PATHS); } }
private CheckoutException buildConflictsException(final ConflictsDatabase conflictsDatabase) { final long conflictCount = conflictsDatabase.getCountByPrefix(null, null); Iterator<Conflict> conflicts = Iterators .limit(conflictsDatabase.getByPrefix(branchOrCommit, null), 25); StringBuilder msg = new StringBuilder(); while (conflicts.hasNext()) { Conflict conflict = conflicts.next(); msg.append("error: " + conflict.getPath() + " needs merge.\n"); } if (conflictCount > 25) { msg.append(String.format("and %,d more.\n", (conflictCount - 25))); } msg.append("You need to resolve your index first.\n"); return new CheckoutException(msg.toString(), StatusCode.UNMERGED_PATHS); } }
@Override protected Iterator<Conflict> _call() { if (repository().isOpen()) { return conflictsDatabase().getByPrefix(null, null); } return Collections.emptyIterator(); }
@Override protected Iterator<Conflict> _call() { if (repository().isOpen()) { return conflictsDatabase().getByPrefix(null, parentPathFilter); } return Collections.emptyIterator(); }
private void testGetByPrefix(String namespace, String treePath, List<Conflict> expected) { Iterator<Conflict> it = conflicts.getByPrefix(namespace, treePath); Map<String, Conflict> actual = new TreeMap<>(Maps.uniqueIndex(it, (c) -> c.getPath())); assertEquals(expected.size(), actual.size()); Map<String, Conflict> expectedMap = new TreeMap<>( Maps.uniqueIndex(expected, (c) -> c.getPath())); assertEquals(expectedMap.keySet(), actual.keySet()); }
private void testGetByPrefix(String namespace, String treePath, List<Conflict> expected) { Iterator<Conflict> it = conflicts.getByPrefix(namespace, treePath); Map<String, Conflict> actual = new TreeMap<>(Maps.uniqueIndex(it, (c) -> c.getPath())); assertEquals(expected.size(), actual.size()); Map<String, Conflict> expectedMap = new TreeMap<>( Maps.uniqueIndex(expected, (c) -> c.getPath())); assertEquals(expectedMap.keySet(), actual.keySet()); }