svnkit: how to get latest revision number from SVN DB?

后端 未结 3 788
孤独总比滥情好
孤独总比滥情好 2020-12-20 07:14

I want to get the latest revision number of the SVN database using SVNKIT. I don\'t want to update the local repository and get the head revision number , i want to directly

3条回答
  •  悲哀的现实
    2020-12-20 07:59

    FSRepositoryFactory.setup();
    File pathToRepository = new File("/path/to/repository");
    SVNRepository svnRepository = SVNRepositoryFactory.create(SVNURL.fromFile(pathToRepository));
    try {
        final long latestRevision = svnRepository.getLatestRevision();
        System.out.println("latestRevision = " + latestRevision);
    } finally {
        svnRepository.closeSession();
    }
    

提交回复
热议问题