A note about getting the latest revision number:
Say I've cd
-ed in a revisioned subdirectory (MyProjectDir
). Then, if I call svnversion
:
$ svnversion .
323:340
... I get "323:340
", which I guess means: "you've got items here, ranging from revision 323 to 340".
Then, if I call svn info
:
$ svn info
Path: .
URL: svn+ssh://server.com/path/to/MyProject/MyProjectDir
Repository Root: svn+ssh://server.com/path/to/MyProject
Repository UUID: 0000ffff-ffff-...
Revision: 323
Node Kind: directory
Schedule: normal
Last Changed Author: USER
Last Changed Rev: 323
Last Changed Date: 2011-11-09 18:34:34 +0000 (Wed, 09 Nov 2011)
... I get "323
" as revision - which is actually the lowest revision of those that reported by svnversion
!
We can then use svn info
in recursive mode to get more information from the local directory:
> svn info -R | grep 'Path\|Revision'
Path: .
Revision: 323
Path: file1.txt
Revision: 333
Path: file2.txt
Revision: 327
Path: file3.txt
Revision: 323
Path: subdirA
Revision: 328
Path: subdirA/file1.txt
Revision: 339
Path: subdirA/file1.txt
Revision: 340
Path: file1.txt
Revision: 323
...
... (remove the grep
to see the more details).
Finally, what to do when we want to check what is the latest revision of the online repository (in this case, @ server.com
)? Then we again issue svn info
, but with -r HEAD
(note the difference between capital -R
option previously, and lowercase -r
now):
> svn info -r 'HEAD'
[email protected]'s password:
Path: MyProjectDir
URL: svn+ssh://server.com/path/to/MyProject/MyProjectDir
Repository Root: svn+ssh://server.com/path/to/MyProject
Repository UUID: 0000ffff-ffff-...
Revision: 340
Node Kind: directory
Last Changed Author: USER
Last Changed Rev: 340
Last Changed Date: 2011-11-11 01:53:50 +0000 (Fri, 11 Nov 2011)
The interesting thing is - svn info
still refers to the current subdirectory (MyProjectDir
), however, the online path is reported as MyProjectDir
(as opposed to .
for the local case) - and the online revision reported is the highest (340
- as opposed to the lowest one, 323
reported locally).
$ svn info --show-item revision
svn: invalid option: --show-item
Using Apache Subversion 1.8.16 (r1740329) compiled Apr 26 2016. Also tried with CollabNet 1.6.11 (r934486) compiled Mar 6 2014.svn help info
for the legal options forsvn info
--show-item
is available