scmversion: Improve svn interaction.
PATCH 1/1 scmversion: Improve svn interaction.
Prevent running svn if .svn is not found; some versions of svn will unconditionally create it.
--- xen/tools/scmversion | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
xen/tools/scmversion +1 -1
@@ -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
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
Signed-off-by Andrew Cooper <[email protected]>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@@ -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"
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
Signed-off-by Andrew Cooper <[email protected]>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@@ -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"