private RevCommit callCommit() { final CommitOp commitOp = context.command(CommitOp.class).setAll(true) .setAuthor(authorName, authorEmail).setMessage(commitMessage); commitOp.setProgressListener(getProgressListener()); return commitOp.call(); }
private RevCommit callCommit() { final CommitOp commitOp = context.command(CommitOp.class).setAll(true) .setAuthor(authorName, authorEmail).setMessage(commitMessage); commitOp.setProgressListener(getProgressListener()); return commitOp.call(); }
private RevCommit callCommit() { final CommitOp commitOp = context.command(CommitOp.class).setAll(true) .setAuthor(authorName, authorEmail).setMessage(commitMessage); commitOp.setProgressListener(getProgressListener()); return commitOp.call(); }
private RevCommit callCommit() { final CommitOp commitOp = context.command(CommitOp.class).setAll(true) .setAuthor(authorName, authorEmail).setMessage(commitMessage); commitOp.setProgressListener(getProgressListener()); return commitOp.call(); }
private List<RevCommit> insertAndCommit(List<? extends Feature> features, final int featuresPerCommit) throws Exception { List<RevCommit> commits = new LinkedList<>(); int i = 0; for (List<? extends Feature> partition : Iterables.partition(features, featuresPerCommit)) { insert(remoteRepo, partition); add(remoteRepo); String from = partition.get(0).getIdentifier().toString(); String to = partition.get(partition.size() - 1).getIdentifier().toString(); String message = String.format("commit features %s to %s", from, to); RevCommit commit = remoteRepo.command(CommitOp.class).setMessage(message) .setProgressListener(SIMPLE_PROGRESS).call(); commits.add(0, commit); i++; } return commits; }
private List<RevCommit> insertAndCommit(List<? extends Feature> features, final int featuresPerCommit) throws Exception { List<RevCommit> commits = new LinkedList<>(); int i = 0; for (List<? extends Feature> partition : Iterables.partition(features, featuresPerCommit)) { insert(remoteRepo, partition); add(remoteRepo); String from = partition.get(0).getIdentifier().toString(); String to = partition.get(partition.size() - 1).getIdentifier().toString(); String message = String.format("commit features %s to %s", from, to); RevCommit commit = remoteRepo.command(CommitOp.class).setMessage(message) .setProgressListener(SIMPLE_PROGRESS).call(); commits.add(0, commit); i++; } return commits; }
@Test public void testCancel() throws Exception { ProgressListener listener1 = mock(ProgressListener.class); when(listener1.isCanceled()).thenReturn(true); ProgressListener listener2 = mock(ProgressListener.class); when(listener2.isCanceled()).thenReturn(false, true); ProgressListener listener3 = mock(ProgressListener.class); when(listener3.isCanceled()).thenReturn(false, false, true); CommitOp commitCommand1 = geogig.command(CommitOp.class); commitCommand1.setProgressListener(listener1); assertNull(commitCommand1.setAllowEmpty(true).call()); CommitOp commitCommand2 = geogig.command(CommitOp.class); commitCommand2.setProgressListener(listener2); assertNull(commitCommand2.setAllowEmpty(true).call()); CommitOp commitCommand3 = geogig.command(CommitOp.class); commitCommand3.setProgressListener(listener3); assertNull(commitCommand3.setAllowEmpty(true).call()); verify(listener1, times(1)).isCanceled(); verify(listener2, times(2)).isCanceled(); verify(listener3, times(3)).isCanceled(); }
@Test public void testCancel() throws Exception { ProgressListener listener1 = mock(ProgressListener.class); when(listener1.isCanceled()).thenReturn(true); ProgressListener listener2 = mock(ProgressListener.class); when(listener2.isCanceled()).thenReturn(false, true); ProgressListener listener3 = mock(ProgressListener.class); when(listener3.isCanceled()).thenReturn(false, false, true); CommitOp commitCommand1 = geogig.command(CommitOp.class); commitCommand1.setProgressListener(listener1); assertNull(commitCommand1.setAllowEmpty(true).call()); CommitOp commitCommand2 = geogig.command(CommitOp.class); commitCommand2.setProgressListener(listener2); assertNull(commitCommand2.setAllowEmpty(true).call()); CommitOp commitCommand3 = geogig.command(CommitOp.class); commitCommand3.setProgressListener(listener3); assertNull(commitCommand3.setAllowEmpty(true).call()); verify(listener1, times(1)).isCanceled(); verify(listener2, times(2)).isCanceled(); verify(listener3, times(3)).isCanceled(); }
progressListener.setDescription("Committing features..."); command(CommitOp.class).setMessage(message) .setProgressListener(progressListener).call(); OSMLogEntry entry = new OSMLogEntry(newTreeId, report.getLatestChangeset(), report.getLatestTimestamp());
commitOp.setCommit(geogig.getRepository().getCommit(commitId.get())); commit = commitOp.setPathFilters(pathFilters).setProgressListener(progress).call(); } catch (NothingToCommitException | IllegalStateException notificationError) {
commitOp.setCommit(geogig.getRepository().getCommit(commitId.get())); commit = commitOp.setPathFilters(pathFilters).setProgressListener(progress).call(); } catch (NothingToCommitException | ConflictsException | IllegalStateException notificationError) {
commitOp.setCommit(geogig.getRepository().getCommit(commitId.get())); commit = commitOp.setPathFilters(pathFilters).setProgressListener(progress).call(); } catch (NothingToCommitException | IllegalStateException notificationError) {
if (message != null) { transaction.command(CommitOp.class).setAmend(true).setMessage(message) .setProgressListener(progress).call();