BaseUpdateCommandListener (final File[] paths, final AtomicReference<long[]> updatedToRevision, final File base) { return new BaseUpdateCommandListener(base, myDispatcher) { final long[] myRevisions = new long[paths.length]; @Override protected void beforeHandler(@NotNull ProgressEvent event) { if (EventAction.UPDATE_COMPLETED.equals(event.getAction())) { final long eventRevision = event.getRevision(); for (int i = 0; i < paths.length; i++) { final File path = paths[i]; if (FileUtil.filesEqual(path, event.getFile())) { myRevisions[i] = eventRevision; break; } } } } @Override public void processTerminated(int exitCode) { super.processTerminated(exitCode); updatedToRevision.set(myRevisions); } }; }