From 7c67dac71333bd299c50ef08b6d874e29d991745 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Tue, 8 Jan 2013 01:49:05 +0000 Subject: [PATCH] [DEVELOPMENT ENVIRONMENT] * BUG: Don't crash if svn program is not installed. git-svn-id: svn://localhost/gambas/trunk@5496 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- app/src/gambas3/.lang/.pot | 2 +- .../.src/Subversion/VersionControl.module | 39 ++++++++++++------- 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/app/src/gambas3/.lang/.pot b/app/src/gambas3/.lang/.pot index 5608a5b09..0d5420809 100644 --- a/app/src/gambas3/.lang/.pot +++ b/app/src/gambas3/.lang/.pot @@ -6236,6 +6236,6 @@ msgstr "" msgid "Cannot save file !" msgstr "" -#: VersionControl.module:97 +#: VersionControl.module:110 msgid "command timeout" msgstr "" diff --git a/app/src/gambas3/.src/Subversion/VersionControl.module b/app/src/gambas3/.src/Subversion/VersionControl.module index d1c23d5d8..9b7bab1dc 100644 --- a/app/src/gambas3/.src/Subversion/VersionControl.module +++ b/app/src/gambas3/.src/Subversion/VersionControl.module @@ -1,5 +1,8 @@ ' Gambas module file +Private $bCheckSVN As Boolean +Private $bHasSVN As Boolean + Private $bSVN As Boolean Private $bCVS As Boolean Private $bEnd As Boolean @@ -26,22 +29,32 @@ Public Sub Refresh() Dim sResult As String - If Not $sSvnVersion Then - Exec ["svn", "--version", "--quiet"] To $sSvnVersion - $sSvnVersion = Trim($sSvnVersion) - $bSvn17 = $sSvnVersion Begins "1.7." + If Not $bCheckSVN Then + Exec ["which", "svn"] To sResult + $bHasSVN = Trim(sResult) + $bCheckSVN = True + Endif + + If $bHasSVN Then + + If Not $sSvnVersion Then + Exec ["svn", "--version", "--quiet"] To $sSvnVersion + $sSvnVersion = Trim($sSvnVersion) + $bSvn17 = $sSvnVersion Begins "1.7." + Endif + + If $bSvn17 Then + $bSVN = False + Shell "svn status " & Shell$(SvnPath$(Project.Dir) &/ ".project") & " 2>&1" To sResult + If Process.LastValue = 0 And If sResult Not Like "svn:*W155007*:*" Then $bSvn = True + Else + $bSVN = Exist(Project.Dir &/ ".svn") + Endif + Endif $bCVS = Exist(Project.Dir &/ "CVS") Or Exist(Project.Dir &/ "CVSROOT") - - If $bSvn17 Then - $bSVN = False - Shell "svn status " & Shell$(SvnPath$(Project.Dir) &/ ".project") & " 2>&1" To sResult - If Process.LastValue = 0 And If sResult Not Like "svn:*W155007*:*" Then $bSvn = True - Else - $bSVN = Exist(Project.Dir &/ ".svn") - Endif - + End Private Sub Insert(sText As String)