System.out.println("Comparing full history...");
    public static void main(String[] args) {        if (args.length < 4) {            System.out.println("Expected input values: 1. source repository url. 2. destination repository url. 3. source working copy dir. 4. destination working copy dir. [5.] top revision to copy up to");            SVNDebugLog.getDefaultLog().info("Expected input values: 1. source repository url. 2. destination repository url. 3. source working copy dir. 4. destination working copy dir. [5.] top revision to copy up to");            System.exit(1);        }        String sourceRepositoryUrl = args[0];        String targetRepositoryUrl = args[1];        long fromRev = args.length > 2 ? Long.parseLong(args[2]) : 1;        long topRev = args.length > 3 ? Long.parseLong(args[3]) : -1;        boolean useWC = true;        if (args.length > 6) {            if (Integer.parseInt(args[6]) == 0) {                useWC = false;            }        }        String sourceWC = args.length > 7 ? args[7] : null;        String targetWC = args.length > 8 ? args[8] : null;        if (useWC && (sourceWC == null || targetWC == null)) {            System.out.println("Both WC root dirs (source and target) must be specified");            SVNDebugLog.getDefaultLog().info("Both WC root dirs (source and target) must be specified");            System.exit(1);        }        boolean passed = false;        FSRepositoryFactory.setup();        SVNRepositoryFactoryImpl.setup();        DAVRepositoryFactory.setup();        try {            SVNURL srcURL = SVNURL.parseURIDecoded(sourceRepositoryUrl);            SVNURL dstURL = SVNURL.parseURIDecoded(targetRepositoryUrl);            SVNRepository src = SVNRepositoryFactory.create(srcURL);            SVNRepository dst = SVNRepositoryFactory.create(dstURL);            long latestRev = src.getLatestRevision();            topRev = topRev > 0 && topRev <= latestRev ? topRev : latestRev;            SVNRepositoryReplicator replicator = SVNRepositoryReplicator.newInstance();            long processedRevs = replicator.replicateRepository(src, dst, fromRev, topRev);            System.out.println("Number of processed revisions: " + processedRevs);            SVNDebugLog.getDefaultLog().info("Number of processed revisions: " + processedRevs);            // compare history logs            System.out.println("Comparing full history...");            SVNDebugLog.getDefaultLog().info("Comparing full history...");            compareHistory(src, dst);            long startComparisonRev = args.length > 4 ? Long.parseLong(args[4]) : 1;            startComparisonRev = startComparisonRev <= 0 ? 1 : startComparisonRev;            long endComparisonRev = args.length > 5 ? Long.parseLong(args[5]) : topRev;            endComparisonRev = endComparisonRev <= 0 ? topRev : endComparisonRev;            passed = useWC ? compareRepositoriesWithWC(srcURL, dstURL, startComparisonRev, endComparisonRev, new File(sourceWC), new File(targetWC)) : compareRepositoriesWithoutWC(src, dst,                    startComparisonRev, endComparisonRev);        } catch (SVNException svne) {            SVNDebugLog.getDefaultLog().info("Repositories comparing test FAILED with errors: " + svne.getErrorMessage().getMessage());            System.out.println("Repositories comparing test FAILED with errors: " + svne.getErrorMessage().getMessage());            System.out.println(svne.getErrorMessage().getMessage());            System.exit(1);        }        if (passed) {            SVNDebugLog.getDefaultLog().info("Repositories comparing test PASSED");            System.out.println("Repositories comparing test PASSED");        } else {            SVNDebugLog.getDefaultLog().info("Repositories comparing test FAILED");            System.out.println("Repositories comparing test FAILED");            System.exit(1);        }    }