long () { if (! detectStartRevision()) return -1; final Ref<Long> latest = new Ref<>(-1L); try { if (myEndNumber == -1) { myEndNumber = getLatestRevision(); } final Url existingParent = getExistingParent(myUrl); if (existingParent == null) { return myStartNumber; } final Revision startRevision = Revision.of(myStartNumber); Target target = Target.on(existingParent, startRevision); myVcs.getFactory(target).createHistoryClient().doLog(target, startRevision, Revision.HEAD, false, true, false, 0, null, createHandler(latest)); } catch (VcsException e) { LOG.info(e); } return latest.get().longValue(); }