Reputation: 152206
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:
svn update
and gets the latest version of the project: r10
,r11
,r12
,User A needs to know if there is any changes in the repository without updating the project, so he calls:
svn log BASE:HEAD
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
Reputation: 30662
Updates and commits in Subversion are separate! That's why svn info
shows 10
after you commit.
I guess that you actually want to use svnversion
tool. Try svnversion -c
.
You can also run svn update
and check the last line that always says At revision REVNUM
.
Upvotes: 3
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