Prevent running svn if .svn is not found; some versions of svn will
unconditionally create it.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Marek Marczykowski <marmarek@invisiblethingslab.com>
CC: Keir Fraser <keir@xen.org>
CC: Jan Beulich <jbeulich@suse.com>
CC: Ian Campbell <ian.campbell@citrix.com>
CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
xen/tools/scmversion | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/xen/tools/scmversion b/xen/tools/scmversion
index b0c3b95..ccc6334 100755
--- a/xen/tools/scmversion
+++ b/xen/tools/scmversion
@@ -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"
--
1.7.10.4
On Thu, 2013-08-01 at 13:45 +0100, Andrew Cooper wrote:> 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.> > Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> > CC: Marek Marczykowski <marmarek@invisiblethingslab.com> > CC: Keir Fraser <keir@xen.org> > CC: Jan Beulich <jbeulich@suse.com> > CC: Ian Campbell <ian.campbell@citrix.com> > CC: Ian Jackson <Ian.Jackson@eu.citrix.com> > --- > xen/tools/scmversion | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/xen/tools/scmversion b/xen/tools/scmversion > index b0c3b95..ccc6334 100755 > --- a/xen/tools/scmversion > +++ b/xen/tools/scmversion > @@ -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" >
On 01/08/13 16:44, Ian Campbell wrote:> On Thu, 2013-08-01 at 13:45 +0100, Andrew Cooper wrote: >> 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> >> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> >> CC: Marek Marczykowski <marmarek@invisiblethingslab.com> >> CC: Keir Fraser <keir@xen.org> >> CC: Jan Beulich <jbeulich@suse.com> >> CC: Ian Campbell <ian.campbell@citrix.com> >> CC: Ian Jackson <Ian.Jackson@eu.citrix.com> >> --- >> xen/tools/scmversion | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/xen/tools/scmversion b/xen/tools/scmversion >> index b0c3b95..ccc6334 100755 >> --- a/xen/tools/scmversion >> +++ b/xen/tools/scmversion >> @@ -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" >> >