aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/setlocalversion
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/setlocalversion')
-rwxr-xr-x[-rw-r--r--]scripts/setlocalversion16
1 files changed, 16 insertions, 0 deletions
diff --git a/scripts/setlocalversion b/scripts/setlocalversion
index 52f032e409a3..1c1bdaf7348a 100644..100755
--- a/scripts/setlocalversion
+++ b/scripts/setlocalversion
@@ -45,3 +45,19 @@ if hgid=`hg id 2>/dev/null`; then
45 # All done with mercurial 45 # All done with mercurial
46 exit 46 exit
47fi 47fi
48
49# Check for svn and a svn repo.
50if rev=`svn info 2>/dev/null | grep '^Revision'`; then
51 rev=`echo $rev | awk '{print $NF}'`
52 changes=`svn status 2>/dev/null | grep '^[AMD]' | wc -l`
53
54 # Are there uncommitted changes?
55 if [ $changes != 0 ]; then
56 printf -- '-svn%s%s%s' "$rev" -dirty "$changes"
57 else
58 printf -- '-svn%s' "$rev"
59 fi
60
61 # All done with svn
62 exit
63fi