The command "svnlook youngest $path_to_repo" gives easy command-line access to
the latest revision of a repository, but unfortunately, it requires direct file
access to the repository. What I want is an equivalent command that can also
perform this query remotely via a repository URL.
Suggestion: this new command might either have the form of a new command "svn
youngest $url", or, perhaps even better, a new option "svn info --field revision
$url" to the existing "info" command, which extracts only the one desired field
(revision, last_changed_rev, etc.) from the normal output of "input".
Ugly workaround:
$ svn info $url | grep '^Revision:' | cut -f2 -d ' '
Application example:
With svnmucc now being fully supported, there exists now a way to write scripts
that perform automatic edits without having to check out a working file first.
To make such scripts transaction safe, both the "svn cat" and "svnmucc put"
command must specify the same revision in option -r, such that the transaction
fails if there is a conflict. So there is now an important script pattern where
a script needs to be able to find out what the latest revision number is:
$ latest=`svnlook youngest path-to-repos`
$ svn cat -r $latest $url | sed -e 's/old/new/' | svnmucc put -r $latest $url
It would be good if we could replace the first line of that script with e.g.
$ latest=`svn youngest $url`
such that such automatic repository edits can also be executed remotely.
An alternative to simply adding the new command "youngest" to "svn" would be to
add a new option --field to the existing "svn info" command, which reduces the
output to the value of a single field:
$ svn info --field revision $url
1583
as opposed to
$ svn info $url
[...]
Revision: 1583
[...]
Related discussion:
http://code.google.com/p/svnbook/issues/detail?id=5#c7
http://svnbook.red-bean.com/nightly/en/svn.advanced.working-without-a-wc.html#svn.advanced.working-without-a-wc.svnmucc
http://code.google.com/p/svnbook/issues/detail?id=5#c7