summaryrefslogtreecommitdiffstats
path: root/scripts/svnversions
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/svnversions')
-rwxr-xr-xscripts/svnversions51
1 files changed, 51 insertions, 0 deletions
diff --git a/scripts/svnversions b/scripts/svnversions
new file mode 100755
index 00000000..fbdca03b
--- /dev/null
+++ b/scripts/svnversions
@@ -0,0 +1,51 @@
+#! /usr/bin/env bash
+unset LANG LC_ALL
+LC_ALL=C
+export LC_ALL
+
+if [ $# -eq 1 ]; then
+ svn info $1 | awk '/^Last Changed Rev/ { print $4 }'
+else
+ for f; do
+ svn info $f | awk "/^Last Changed Rev/ { print \"$f\", \$4 }"
+ done
+fi
+
+exit
+
+=head1 NAME
+
+svnversions -- Displays version of the files passed as argument.
+
+=head1 SYNOPSIS
+
+ svnversions <file1> [<file2> [...]]
+
+=head1 DESCRIPTION
+
+svnversions displays the last revision a file in Subversion was
+changed, as known by the local checked out directory. No connection is
+required to the Subversion server. It is equivalent to the "COMMITTED"
+revision name.
+
+Unlike svnversion(1), this program returns the revision a file was
+modified. svnversion(1) tells the revision a working dir is at.
+
+It can be used in other scripts, or simply to ask for diffs using
+
+svn diff -r [<version>:]<version> <file(s)>
+
+=head1 AUTHOR
+
+Thiago Macieira <thiago@kde.org>
+
+Inspired on cvsversion, written by
+David Faure <faure@kde.org>
+
+=head1 SEE ALSO
+
+This command parses the output from 'svn info'.
+
+ svn(1), svnversion(1)
+
+=cut