// Path: extensions/jashing-cvs/src/main/java/com/github/avarabyeu/jashing/integration/vcs/AbstractVCSClient.java
// public abstract class AbstractVCSClient implements VCSClient {
// 
//     @Override
//     public Map<String, Long> getCommitsPerUser(@Nonnull Instant from) {
//         return getCommitsPerUser(from, null);
//     }
// 
//     @Override
//     public long getCommitsForPeriod(@Nonnull Instant from) {
//         return getCommitsForPeriod(from, null);
//     }
// }
// 
// Path: extensions/jashing-cvs/src/main/java/com/github/avarabyeu/jashing/integration/vcs/VCSClient.java
// public interface VCSClient {
// 
//     /**
//      * Returns commits count per user for specified time period
//      *
//      * @param from start time
//      * @param to   end time
//      * @return {@code {Map<User name, Commits count></User>}}
//      */
//     Map<String, Long> getCommitsPerUser(@Nonnull Instant from, @Nullable Instant to);
// 
//     /**
//      * Returns commits count per user from specified time till now
//      *
//      * @param from start time
//      * @return {@code {Map<User name, Commits count></User>}}
//      */
//     Map<String, Long> getCommitsPerUser(@Nonnull Instant from);
// 
//     /**
//      * Returns commits count for all users for specified time period
//      *
//      * @param from start time
//      * @param to   end time
//      * @return commits count
//      */
//     long getCommitsForPeriod(@Nonnull Instant from, @Nullable Instant to);
// 
//     /**
//      * Returns commits count for all users from specified specified time till now
//      *
//      * @param from start time
//      * @return commits count
//      */
//     long getCommitsForPeriod(@Nonnull Instant from);
// }
// 
// Path: extensions/jashing-cvs/src/main/java/com/github/avarabyeu/jashing/integration/vcs/VCSClientException.java
// public class VCSClientException extends RuntimeException {
// 
//     public VCSClientException(String message) {
//         super(message);
//     }
// 
//     public VCSClientException(String message, Throwable cause) {
//         super(message, cause);
//     }
// }


import com.github.avarabyeu.jashing.integration.vcs.AbstractVCSClient;
import com.github.avarabyeu.jashing.integration.vcs.VCSClient;
import com.github.avarabyeu.jashing.integration.vcs.VCSClientException;
import com.google.common.net.UrlEscapers;
import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.SVNURL;
import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager;
import org.tmatesoft.svn.core.internal.io.dav.DAVRepositoryFactory;
import org.tmatesoft.svn.core.wc.SVNRevision;
import org.tmatesoft.svn.core.wc.SVNWCUtil;
import org.tmatesoft.svn.core.wc2.*;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.time.Instant;
import java.time.ZoneId;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
            svnOperationFactory = new SvnOperationFactory();
            svnOperationFactory.setAuthenticationManager(authManager);

        } catch (SVNException e) {
            throw new VCSClientException("Unable to initialize svn client", e);

        }
    }

    @Override
    public Map<String, Long> getCommitsPerUser(@Nonnull Instant from, @Nullable Instant to) {
        try {
            Map<String, Long> commiters = new HashMap<>();
            final SvnLog log = svnOperationFactory.createLog();
            log.setSingleTarget(SvnTarget.fromURL(svnUrl));

            SVNRevision endRevision = to == null ? SVNRevision.HEAD : SVNRevision.create(Date.from(to));
            log.addRange(SvnRevisionRange.create(SVNRevision.create(Date.from(from.atZone(ZoneId.systemDefault()).toInstant())), endRevision));
            log.setDiscoverChangedPaths(false);
            log.setReceiver((svnTarget, svnLogEntry) -> {
                Long authorCommits = commiters.get(svnLogEntry.getAuthor());
                if (null == authorCommits) {
                    commiters.put(svnLogEntry.getAuthor(), 1L);
                } else {
                    commiters.put(svnLogEntry.getAuthor(), ++authorCommits);
                }
            });
            run(log);
            return commiters;
        } catch (SVNException e) {
// Path: extensions/jashing-cvs/src/main/java/com/github/avarabyeu/jashing/integration/vcs/AbstractVCSClient.java
// public abstract class AbstractVCSClient implements VCSClient {
// 
//     @Override
//     public Map<String, Long> getCommitsPerUser(@Nonnull Instant from) {
//         return getCommitsPerUser(from, null);
//     }
// 
//     @Override
//     public long getCommitsForPeriod(@Nonnull Instant from) {
//         return getCommitsForPeriod(from, null);
//     }
// }
// 
// Path: extensions/jashing-cvs/src/main/java/com/github/avarabyeu/jashing/integration/vcs/VCSClient.java
// public interface VCSClient {
// 
//     /**
//      * Returns commits count per user for specified time period
//      *
//      * @param from start time
//      * @param to   end time
//      * @return {@code {Map<User name, Commits count></User>}}
//      */
//     Map<String, Long> getCommitsPerUser(@Nonnull Instant from, @Nullable Instant to);
// 
//     /**
//      * Returns commits count per user from specified time till now
//      *
//      * @param from start time
//      * @return {@code {Map<User name, Commits count></User>}}
//      */
//     Map<String, Long> getCommitsPerUser(@Nonnull Instant from);
// 
//     /**
//      * Returns commits count for all users for specified time period
//      *
//      * @param from start time
//      * @param to   end time
//      * @return commits count
//      */
//     long getCommitsForPeriod(@Nonnull Instant from, @Nullable Instant to);
// 
//     /**
//      * Returns commits count for all users from specified specified time till now
//      *
//      * @param from start time
//      * @return commits count
//      */
//     long getCommitsForPeriod(@Nonnull Instant from);
// }
// 
// Path: extensions/jashing-cvs/src/main/java/com/github/avarabyeu/jashing/integration/vcs/VCSClientException.java
// public class VCSClientException extends RuntimeException {
// 
//     public VCSClientException(String message) {
//         super(message);
//     }
// 
//     public VCSClientException(String message, Throwable cause) {
//         super(message, cause);
//     }
// }


// Path: extensions/jashing-svn/src/main/java/com/github/avarabyeu/jashing/integration/vcs/svn/SvnClient.java
import com.github.avarabyeu.jashing.integration.vcs.AbstractVCSClient;
import com.github.avarabyeu.jashing.integration.vcs.VCSClient;
import com.github.avarabyeu.jashing.integration.vcs.VCSClientException;
import com.google.common.net.UrlEscapers;
import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.SVNURL;
import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager;
import org.tmatesoft.svn.core.internal.io.dav.DAVRepositoryFactory;
import org.tmatesoft.svn.core.wc.SVNRevision;
import org.tmatesoft.svn.core.wc.SVNWCUtil;
import org.tmatesoft.svn.core.wc2.*;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.time.Instant;
import java.time.ZoneId;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;

            svnOperationFactory = new SvnOperationFactory();
            svnOperationFactory.setAuthenticationManager(authManager);

        } catch (SVNException e) {
            throw new VCSClientException("Unable to initialize svn client", e);

        }
    }

    @Override
    public Map<String, Long> getCommitsPerUser(@Nonnull Instant from, @Nullable Instant to) {
        try {
            Map<String, Long> commiters = new HashMap<>();
            final SvnLog log = svnOperationFactory.createLog();
            log.setSingleTarget(SvnTarget.fromURL(svnUrl));

            SVNRevision endRevision = to == null ? SVNRevision.HEAD : SVNRevision.create(Date.from(to));
            log.addRange(SvnRevisionRange.create(SVNRevision.create(Date.from(from.atZone(ZoneId.systemDefault()).toInstant())), endRevision));
            log.setDiscoverChangedPaths(false);
            log.setReceiver((svnTarget, svnLogEntry) -> {
                Long authorCommits = commiters.get(svnLogEntry.getAuthor());
                if (null == authorCommits) {
                    commiters.put(svnLogEntry.getAuthor(), 1L);
                } else {
                    commiters.put(svnLogEntry.getAuthor(), ++authorCommits);
                }
            });
            run(log);
            return commiters;
        } catch (SVNException e) {
            throw new VCSClientException("Unable to get revision list for period [" + from + "," + to + "]", e);