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.
Try svnversion -c . You can also run svn update and check the last line that always says At revision REVNUM .
Subversion is used for maintaining current and historical versions of projects. Subversion is an open source centralized version control system. It's licensed under Apache. It's also referred to as a software version and revisioning control system.
SVN Installation To check whether it is installed or not use following command. If Subversion client is not installed, then command will report error, otherwise it will display the version of the installed software. If you are using RPM-based GNU/Linux, then use yum command for installation.
The SVN update Command. The svn update command lets you refresh your locally checked out repository with any changes in the repository HEAD on the server. It also tells you what has been changed, added, deleted. If a change has been made to a file you have also changed locally, svn will try to merge those changes.
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
.
To get the latest revision number of your repo without updating local copy first, use -r HEAD
:
svn info -r HEAD
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With