hsz
hsz

Reputation: 152206

Check current SVN repository version

I'm trying to figure out, how to get the current SVN repository version but with no luck.

When I try with:

svn info -r BASE

I get following information:

Path: foo-svn
URL: file:///home/hsz/Project/foo-svn
Relative URL: ^/
Repository Root: file:///home/hsz/Project/foo-svn
Repository UUID: b5555486-2e29-45ed-a0bb-b925095964a9
Revision: 10
Node Kind: directory
Last Changed Author: hsz
Last Changed Rev: 10
Last Changed Date: 2015-05-28 11:26:50 +0200 (Thu, 28 May 2015)

So there is a lot useless information around it. Also it varies depending on the machine language (english can be forced prepending command with LANG=en_US).

But the real problem is when I commit something. The output of:

svn commit -m "foo"

is:

Committed revision 11.

But svn info still shows information about the revision 10. After updating the project it is the valid version.

Is there any way to obtain the current real version number without updating the whole project ?

edit more complex example:

but it shows too much output:

r10
r11
r12

instead of:

r11
r12

because BASE is r10 instead of r11 which was HIS last commit.

Is it possible to get the number of the CURRENT revision in the local copy ? In this case, after the update and commit it is r11.

Only svn command is supported and no svn update allowed.

Upvotes: 5

Views: 18816

Answers (3)

Champu
Champu

Reputation: 41

svn info --show-item revision -r COMMITTED

Upvotes: 0

bahrep
bahrep

Reputation: 30662

Upvotes: 3

Ivan Jovović
Ivan Jovović

Reputation: 5298

To get the latest revision number of your repo without updating local copy first, use -r HEAD:

svn info -r HEAD

Upvotes: 2

Related Questions