From cdaf152cd76a0d3eedf7defb234d91daaae64008 Mon Sep 17 00:00:00 2001 From: Geert Janssens Date: Fri, 21 Jan 2011 22:10:40 +0000 Subject: [PATCH] Use last changed revision number instead of last-commited-somewhere-in-repo svnversion without options returns the most recent revision in the repo at the time of the last svn update/checkout even if that revision didn't hold any changes in the current path. Not very useful as a reference. Better is to ask for the last changed revision with -c. BUT: -c option for some reason always considers svn working copy as having mixed sources. We're only interested in the last part so we strip the beginning revision if it's there. As a result if your WC really has mixed sources, that will not be visible in the version number... git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@20140 57a11ea4-9604-0410-9ed3-97b8803252fd --- util/gnc-svnversion | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) mode change 100755 => 100644 util/gnc-svnversion diff --git a/util/gnc-svnversion b/util/gnc-svnversion old mode 100755 new mode 100644 index 569cf6f9b9..cb9c926895 --- a/util/gnc-svnversion +++ b/util/gnc-svnversion @@ -47,7 +47,17 @@ fi # If this is an svn checkout we assume you have svnversion! if test -d "${real_srcdir}"/.svn then - svnversion "$real_srcdir" + # svnversion without options returns the most recent revision in the repo + # at the time of the last svn update/checkout even if that revision + # didn't hold any changes in the current path. Not very useful as a + # reference. Better is to ask for the last changed revision with -c. + # BUT: -c option for some reason always considers svn working copy + # as having mixed sources. We're only interested in the last part so + # we strip the beginning revision if it's there. + # As a result if your WC really has mixed sources, that will not be + # visible in the version number... + svn_mixed_version=$(svnversion -c "$real_srcdir") + echo ${svn_mixed_version#*:} exit $? fi