Skip to contentSkip to conversation

scmversion: Improve svn interaction.

PATCH Superseded Andrew Cooper 2 participants 3 messages Aug 1, 2013

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scmversion: Improve svn interaction.

Prevent running svn if .svn is not found; some versions of svn will unconditionally create it.

CC Marek Marczykowski <[email protected]>
CC Keir Fraser <[email protected]>
CC Jan Beulich <[email protected]>
CC Ian Campbell <[email protected]>
CC Ian Jackson <[email protected]>
---
 xen/tools/scmversion |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/tools/scmversion +1 -1
index b0c3b95..ccc6334 100755
@@ -77,7 +77,7 @@ scm_version()
 	fi
 
 	# Check for svn and a svn repo.
-	if rev=`LANG= LC_ALL= LC_MESSAGES=C svn info 2>/dev/null | grep '^Last Changed Rev'`; then
+	if test -d .svn && rev=`LANG= LC_ALL= LC_MESSAGES=C svn info 2>/dev/null | grep '^Last Changed Rev'`; then
 		rev=`echo $rev | awk '{print $NF}'`
 		printf -- 'svn:%s' "$rev"
 
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 2 lines · Andrew Cooper

Prevent running svn if .svn is not found; some versions of svn will unconditionally create it.

I was kind of hoping "improve" might mean "delete" ;-)

We must have inherited this from the Linux version. I can't imagine any reason why you would ever have wanted to import Xen (or Linux for that matter) into a svn tree.

Ian.

Quoted 24 lines
CC Marek Marczykowski <[email protected]>
CC Keir Fraser <[email protected]>
CC Jan Beulich <[email protected]>
CC Ian Campbell <[email protected]>
CC Ian Jackson <[email protected]>
---
 xen/tools/scmversion |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/tools/scmversion +1 -1
index b0c3b95..ccc6334 100755
@@ -77,7 +77,7 @@ scm_version()
 	fi
 
 	# Check for svn and a svn repo.
-	if rev=`LANG= LC_ALL= LC_MESSAGES=C svn info 2>/dev/null | grep '^Last Changed Rev'`; then
+	if test -d .svn && rev=`LANG= LC_ALL= LC_MESSAGES=C svn info 2>/dev/null | grep '^Last Changed Rev'`; then
 		rev=`echo $rev | awk '{print $NF}'`
 		printf -- 'svn:%s' "$rev"
 
#2 lore raw
Quoted 10 lines · Ian Campbell
Quoted 2 lines · Andrew Cooper

Prevent running svn if .svn is not found; some versions of svn will unconditionally create it.

I was kind of hoping "improve" might mean "delete" ;-)

We must have inherited this from the Linux version. I can't imagine any reason why you would ever have wanted to import Xen (or Linux for that matter) into a svn tree.

Ian.

And guess where we found the svn bug ;-)

I will gladly delete the svn stuff if wanted, but figured this was slightly neater and more friendly to people.

~Andrew

Quoted 25 lines
Quoted 24 lines
CC Marek Marczykowski <[email protected]>
CC Keir Fraser <[email protected]>
CC Jan Beulich <[email protected]>
CC Ian Campbell <[email protected]>
CC Ian Jackson <[email protected]>
---
 xen/tools/scmversion |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/tools/scmversion +1 -1
index b0c3b95..ccc6334 100755
@@ -77,7 +77,7 @@ scm_version()
 	fi
 
 	# Check for svn and a svn repo.
-	if rev=`LANG= LC_ALL= LC_MESSAGES=C svn info 2>/dev/null | grep '^Last Changed Rev'`; then
+	if test -d .svn && rev=`LANG= LC_ALL= LC_MESSAGES=C svn info 2>/dev/null | grep '^Last Changed Rev'`; then
 		rev=`echo $rev | awk '{print $NF}'`
 		printf -- 'svn:%s' "$rev"