5

I am using SVNKit 1.3.2 and trying to obtain working copy revision number.

Working copy is checkouted also with SVNKit, but when I'm trying to call

clientManager.getLookClient().doGetYoungestRevision(destination);

I got FileNotFoundException telling me that 'format' file is not found under destination path, ex /path/to/working/copy/format

I can see 2 troubles: - It tries to access 'format' file right in working directory root, while this file supposed to be in .svn folder

  • There is not file in this .svn folder.

Any clues? Thank you!

glaz666
  • 8,707
  • 19
  • 56
  • 75
  • I am having the same problem as you. This is very strange. I've tried your answer, but it's not quite what I need. – Marc-Andre Feb 19 '14 at 15:56

2 Answers2

5

Seems to be it should be done through SVNStatusClient:

clientManager.getStatusClient().doStatus(destination, false).getRevision().getNumber();

Though still don't understand what's the problem with doGetYoungestRevision(destination)...

glaz666
  • 8,707
  • 19
  • 56
  • 75
  • After committing changes in a working copy, I needed to use `.doStatus(wc, true).getRemoteRevision()` to obtain the revision of the commit. `.doStatus(wc, false).getRevision()` just gave me the revision that was initially checked out. There are probably some subtleties here I am missing. – Jesse Glick Aug 30 '16 at 13:44
0

It is not working because doGetYoungestRevision is for a repository, not for a working copy.

I was hoping to achieve the same things as you, and found out that when destination is pointing to a repository, it returns the last revision number of the repository.

The class in itself is for working with repository, you can look at the documentation here.

Marc-Andre
  • 912
  • 1
  • 15
  • 34