[Swift-commit] r2552 - trunk/libexec

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Mon Feb 16 08:36:55 CST 2009


Author: benc
Date: 2009-02-16 08:36:54 -0600 (Mon, 16 Feb 2009)
New Revision: 2552

Modified:
   trunk/libexec/svn-revision
Log:
make build revision handle git-svn repositories, as that is what I am using as vcs now

Modified: trunk/libexec/svn-revision
===================================================================
--- trunk/libexec/svn-revision	2009-02-16 05:14:19 UTC (rev 2551)
+++ trunk/libexec/svn-revision	2009-02-16 14:36:54 UTC (rev 2552)
@@ -1,14 +1,27 @@
 #!/bin/bash
-if [ -x "$(which svn)" ]; then
 
-  R=$(svn info | grep '^Revision' | sed 's/Revision: / swift-r/')
-  M=$(svn status | grep --invert-match '^\?' > /dev/null && echo '(Swift modified locally)')
-  cd ../..
-  CR=$(svn info | grep '^Revision' | sed 's/Revision: / cog-r/')
-  CM=$(svn status | grep --invert-match '^\?' > /dev/null && echo '(CoG modified locally)')
-  echo $R $M $CR $CM
-else
-  echo No SVN information available
-fi
+hereversion() {
+  if [ -d ".svn" ] && [ -x "$(which svn)" ]; then
+    R=$(svn info | grep '^Revision' | sed "s/Revision: /$1-r/")
+    M=$(svn status | grep --invert-match '^\?' > /dev/null && echo '($1 modified locally)')
+  elif [ -d ".git" ] && [ -x "$(which git)" ]; then
+    R=$(git svn info | grep '^Revision' | sed "s/Revision: /$1-r/")
+    if git status -a >/dev/null ; then
+      M="($1 modified locally)"
+    fi 
+  else
+    R="$1-unknown"
+  fi
+  echo $R $M
+}
 
+# Determine Swift revision
 
+SWIFTVER=$(hereversion swift)
+
+cd ../..
+
+COGVER=$(hereversion cog)
+
+echo $SWIFTVER $COGVER
+




More information about the Swift-commit mailing list