From bbd5efa596170e79613c7b2305171a8108e52080 Mon Sep 17 00:00:00 2001 From: Lukas Rytz Date: Wed, 30 Mar 2011 07:06:08 +0000 Subject: fix get-scala-revision script for the case when... fix get-scala-revision script for the case when svn prints some warnings. no review --- project/build/SVN.scala | 2 +- tools/get-git-svn-rev | 29 ----------------------------- tools/get-scala-revision | 3 ++- 3 files changed, 3 insertions(+), 31 deletions(-) delete mode 100755 tools/get-git-svn-rev diff --git a/project/build/SVN.scala b/project/build/SVN.scala index 6a4f845cbc..6a64e727f9 100644 --- a/project/build/SVN.scala +++ b/project/build/SVN.scala @@ -6,7 +6,7 @@ import sbt._ */ class SVN(root: Path) { /** Location of tool which parses svn revision in git-svn repository. */ - val GitSvnRevTool = root / "tools" / "get-git-svn-rev" + val GitSvnRevTool = root / "tools" / "get-scala-revision" val GitSvnRegex = """^Revision:\s*(\d+).*""".r /** diff --git a/tools/get-git-svn-rev b/tools/get-git-svn-rev deleted file mode 100755 index 685ce67a6d..0000000000 --- a/tools/get-git-svn-rev +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh -# -# Usage: get-scala-rev [dir] -# Figures out current scala revision of an svn checkout or -# a git-svn mirror (or a git clone.) -# -# If no dir is given, current working dir is used. - -DIR="" -if [ $# -eq 0 ]; then - DIR=`pwd` -else - DIR=$1 -fi - -cd $DIR - -if [ -d .svn ]; then - svn info . | grep ^Revision | sed 's/Revision: //' -elif [ -d .git ]; then - GIT_PAGER=cat - # this grabs more than one line because otherwise if you have local - # commits which aren't in git-svn it won't see any revision. - git log -10 | grep git-svn-id | head -1 | sed 's/[^@]*@\([0-9]*\).*/\1/' -else - echo "${DIR} doesn't appear to be git or svn dir." >&2 - echo 0 - exit 1 -fi diff --git a/tools/get-scala-revision b/tools/get-scala-revision index 685ce67a6d..4d6e67f79e 100755 --- a/tools/get-scala-revision +++ b/tools/get-scala-revision @@ -16,7 +16,8 @@ fi cd $DIR if [ -d .svn ]; then - svn info . | grep ^Revision | sed 's/Revision: //' + # 2>&1 to catch also error output (e.g. svn warnings) + svn info . 2>&1 | grep ^Revision | sed 's/Revision: //' elif [ -d .git ]; then GIT_PAGER=cat # this grabs more than one line because otherwise if you have local -- cgit v1.2.3