Farbflash projects: Imaging lingo table | 3-D scene list | Find all | Handler menu | Lingo message window

Ignore:
Timestamp:
04/06/08 09:33:26 (4 years ago)
Author:
alex
Message:

implemented version control when commiting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lingosource/castlib1/svn_Utilities.ls

    r151 r161  
    18091809   
    18101810   
    1811   theResult = mSVN_Commit_CurrentScripts_ScriptText(me, 0, chooseNewPath, commitMsg, 1) 
     1811  theResult = mSVN_Commit_CurrentScripts_ScriptText(me, 0, chooseNewPath, commitMsg, 1, void, 2) 
    18121812   
    18131813  theResult = mSVN_Commit_CurrentMovie_Binaries(me, chooseNewPath, commitMsg, 1) 
    18141814   
     1815end 
     1816 
     1817-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     1818 
     1819on mGetCurrentRevision me, svnBinary, WorkingFolder 
     1820   
     1821  versionNumber = mDoShellCmd(me, svnBinary && QUOTE & WorkingFolder & QUOTE, RETURN, 0, 1) 
     1822  if count(versionNumber) < 1 then return void 
     1823  versionNumber = versionNumber[1] 
     1824   
     1825  offs = offset(":", versionNumber) 
     1826  if offs > 0 then delete char 1 to offs of versionNumber 
     1827   
     1828  if length(versionNumber) < 1 then return void 
     1829   
     1830  versionNumberInt = integer(versionNumber) 
     1831  repeat while not(integerP(versionNumberInt)) 
     1832    if length(versionNumber) < 1 then return void 
     1833    delete the last char of versionNumber 
     1834    versionNumberInt = integer(versionNumber) 
     1835  end repeat 
     1836   
     1837  return versionNumberInt 
    18151838   
    18161839end 
     
    18311854   
    18321855   
    1833   theResult = mSVN_Commit_CurrentScripts_ScriptText(me, castlib(the activecastlib), chooseNewPath, commitMsg, 1, selectionList) 
     1856  theResult = mSVN_Commit_CurrentScripts_ScriptText(me, castlib(the activecastlib), chooseNewPath, commitMsg, 1, selectionList, 2) 
    18341857   
    18351858  theResult = mSVN_Commit_SelectedCastlib(me, chooseNewPath, commitMsg, 1, 0, selectionList) 
     
    19311954    --   end if 
    19321955     
     1956     
     1957    -------------------- get version number: 
     1958    if the platform contains "mac" then 
     1959      svnBin = baUnixName(svnBinary) 
     1960      workFolder = baUnixName(workingFolder) 
     1961    else 
     1962      workFolder = workingFolder 
     1963      if the last char of workFolder = the last char of the applicationpath then delete the last char of workFolder 
     1964    end if 
     1965    versionNumber = mGetCurrentRevision(me, svnBin & "version", workFolder) 
     1966     
     1967    if integerP(versionNumber) then 
     1968       
     1969      versionNumber = versionNumber + 2 -- the version will raise 
     1970       
     1971      VersionCheckUrl = string(mGetVersionCheckUrl(me, the moviepath & the moviename, workingCopies, "Select an URL to use for version checking.")) 
     1972      if length(VersionCheckUrl) > 0 then 
     1973        mscript = member("aleXtrasMovieScript") 
     1974        ident = "" 
     1975        if mGetMemType(me, mscript) = #script then ident = string(xscr().mGetThisMovieName()) 
     1976        if length(ident) < 1 then ident = the moviename 
     1977         
     1978        placeholder = "%%password:" 
     1979        offs = offset(placeholder, VersionCheckUrl) 
     1980        if offs > 0 then 
     1981          thePassword = VersionCheckUrl.char[offs+length(placeholder) .. length(VersionCheckUrl)] 
     1982          thePassword = word 1 to thePassword.word.count of thePassword 
     1983          delete char offs to length(VersionCheckUrl) of VersionCheckUrl 
     1984        end if 
     1985         
     1986        VersionCheckUrl = word 1 to VersionCheckUrl.word.count of VersionCheckUrl & "?movieName=" & ident 
     1987         
     1988        updateurl = 0 
     1989        repeat with cl in castlibList 
     1990          versmem = member("subversion_version_field", cl) 
     1991          if [#field, #text].getPos(mGetMemType(me, versmem)) > 0 then 
     1992            if updateurl = 0 then updateurl = 1 
     1993            curr = versmem.text 
     1994            if char 1 of curr = "r" then delete char 1 of curr 
     1995            curr = integer(curr) 
     1996            if not(integerP(curr)) then curr = 0 
     1997            if curr < versionNumber then 
     1998              versmem.text = "r" & versionNumber 
     1999              versmem.comments = VersionCheckUrl 
     2000            else 
     2001              updateurl = 2 
     2002            end if 
     2003          end if 
     2004        end repeat 
     2005         
     2006        if updateurl = 1 then 
     2007          if length(thePassword) then 
     2008            id = getnettext(VersionCheckUrl & "&version=" & thePassword & versionNumber) 
     2009          end if 
     2010        end if 
     2011         
     2012      end if 
     2013    end if 
     2014    --------------------- // version number 
     2015     
     2016     
    19332017    if isInternal = 1 then 
    19342018      savemovie() 
     
    19412025  end if 
    19422026  ---------------------------------------- 
     2027   
     2028  exit 
    19432029   
    19442030   
     
    21462232    mDisplayWaitStatusText me, "Saving movie..." 
    21472233     
     2234     
     2235    -------------------- get version number: 
     2236    if the platform contains "mac" then 
     2237      svnBin = baUnixName(svnBinary) 
     2238      workFolder = baUnixName(workingFolder) 
     2239    else 
     2240      workFolder = workingFolder 
     2241      if the last char of workFolder = the last char of the applicationpath then delete the last char of workFolder 
     2242    end if 
     2243    versionNumber = mGetCurrentRevision(me, svnBin & "version", workFolder) 
     2244     
     2245    if integerP(versionNumber) then 
     2246       
     2247      versionNumber = versionNumber + 2 -- the version will raise 
     2248       
     2249      VersionCheckUrl = string(mGetVersionCheckUrl(me, the moviepath & the moviename, workingCopies, "Select an URL to use for version checking.")) 
     2250      if length(VersionCheckUrl) > 0 then 
     2251        mscript = member("aleXtrasMovieScript") 
     2252        ident = "" 
     2253        if mGetMemType(me, mscript) = #script then ident = string(xscr().mGetThisMovieName()) 
     2254        if length(ident) < 1 then ident = the moviename 
     2255         
     2256        placeholder = "%%password:" 
     2257        offs = offset(placeholder, VersionCheckUrl) 
     2258        if offs > 0 then 
     2259          thePassword = VersionCheckUrl.char[offs+length(placeholder) .. length(VersionCheckUrl)] 
     2260          thePassword = word 1 to thePassword.word.count of thePassword 
     2261          delete char offs to length(VersionCheckUrl) of VersionCheckUrl 
     2262        end if 
     2263         
     2264        VersionCheckUrl = word 1 to VersionCheckUrl.word.count of VersionCheckUrl & "?movieName=" & ident 
     2265         
     2266        updateurl = 0 
     2267        repeat with cl = the number of castlibs down to 1 
     2268          versmem = member("subversion_version_field", cl) 
     2269          if [#field, #text].getPos(mGetMemType(me, versmem)) > 0 then 
     2270            if updateurl = 0 then updateurl = 1 
     2271            curr = versmem.text 
     2272            if char 1 of curr = "r" then delete char 1 of curr 
     2273            curr = integer(curr) 
     2274            if not(integerP(curr)) then curr = 0 
     2275            if curr < versionNumber then 
     2276              versmem.text = "r" & versionNumber 
     2277              versmem.comments = VersionCheckUrl 
     2278            else 
     2279              updateurl = 2 
     2280            end if 
     2281          end if 
     2282        end repeat 
     2283         
     2284        if updateurl = 1 then 
     2285          if length(thePassword) then 
     2286            id = getnettext(VersionCheckUrl & "&version=" & thePassword & versionNumber) 
     2287          end if 
     2288        end if 
     2289         
     2290      end if 
     2291    end if 
     2292    --------------------- // version number 
     2293     
     2294     
    21482295    saveMovie() 
    21492296     
     
    25892736-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    25902737 
    2591 on mSVN_Commit_CurrentScripts_ScriptText me, selected_Members_Only, chooseNewPath, commitMsg, dontShowAlert, selectionList 
     2738on mSVN_Commit_CurrentScripts_ScriptText me, selected_Members_Only, chooseNewPath, commitMsg, dontShowAlert, selectionList, versionIncrease 
    25922739   
    25932740  workingCopies = value(getPref("svn_workingCopies_paths.txt")) 
     
    26312778   
    26322779   
     2780   
     2781  -------------------- get version number: 
     2782  VersionCheckUrl = "" 
     2783   
     2784  if the platform contains "mac" then 
     2785    svnBin = baUnixName(svnBinary) 
     2786    workFolder = baUnixName(workingFolder) 
     2787  else 
     2788    workFolder = workingFolder 
     2789    if the last char of workFolder = the last char of the applicationpath then delete the last char of workFolder 
     2790  end if 
     2791  versionNumber = mGetCurrentRevision(me, svnBin & "version", workFolder) 
     2792   
     2793  if integerP(versionNumber) then 
     2794     
     2795    if voidP(versionIncrease) then versionIncrease = 1 
     2796    versionNumber = versionNumber + versionIncrease + 1 -- the version will raise 
     2797     
     2798    VersionCheckUrl = string(mGetVersionCheckUrl(me, the moviepath & the moviename, workingCopies, "Select an URL to use for version checking.")) 
     2799    if length(VersionCheckUrl) > 0 then 
     2800      mscript = member("aleXtrasMovieScript") 
     2801      ident = "" 
     2802      if mGetMemType(me, mscript) = #script then ident = string(xscr().mGetThisMovieName()) 
     2803      if length(ident) < 1 then ident = the moviename 
     2804       
     2805      placeholder = "%%password:" 
     2806      offs = offset(placeholder, VersionCheckUrl) 
     2807      if offs > 0 then 
     2808        thePassword = VersionCheckUrl.char[offs+length(placeholder) .. length(VersionCheckUrl)] 
     2809        thePassword = word 1 to thePassword.word.count of thePassword 
     2810        delete char offs to length(VersionCheckUrl) of VersionCheckUrl 
     2811      end if 
     2812       
     2813      VersionCheckUrl = word 1 to VersionCheckUrl.word.count of VersionCheckUrl & "?movieName=" & ident 
     2814       
     2815    end if 
     2816     
     2817  end if 
     2818  --------------------- // version number 
     2819   
     2820   
     2821   
     2822   
    26332823  -------- if we work on only one castlib: 
    26342824   
    26352825  if ilk(selected_Members_Only) = #castLib then 
    2636      
    26372826     
    26382827    ----------------------------------------------------- 
     
    26942883    the itemdelimiter = delim 
    26952884     
     2885    updateurl = 0 
     2886     
    26962887    repeat with n = count(castlibList) down to 1 
    26972888       
     
    27002891      mDisplayWaitStatusText me, "Saving castlib:" && selected_Members_Only 
    27012892       
     2893       
     2894      -------------------- get version number: 
     2895       
     2896      if length(VersionCheckUrl) > 0 then 
     2897        versmem = member("subversion_version_field", n) 
     2898        if [#field, #text].getPos(mGetMemType(me, versmem)) > 0 then 
     2899          if updateurl = 0 then updateurl = 1 
     2900          curr = versmem.text 
     2901          if char 1 of curr = "r" then delete char 1 of curr 
     2902          curr = integer(curr) 
     2903          if not(integerP(curr)) then curr = 0 
     2904          if curr < versionNumber then 
     2905            versmem.text = "r" & versionNumber 
     2906            versmem.comments = VersionCheckUrl 
     2907          else 
     2908            updateurl = 2 
     2909          end if 
     2910        end if 
     2911      end if 
     2912      --------------------- // version number 
     2913       
     2914       
    27022915      selected_Members_Only.save() 
    2703        
    2704        
    27052916       
    27062917      if the last item of workingFolder = "castlib" & selected_Members_Only.number then 
     
    27192930    end repeat 
    27202931     
     2932    -------------------- get version number: 
     2933    if updateurl = 1 then 
     2934      if length(thePassword) then 
     2935        id = getnettext(VersionCheckUrl & "&version=" & thePassword & versionNumber) 
     2936      end if 
     2937    end if 
     2938    --------------------- // version number 
     2939     
    27212940    the itemdelimiter = olddelim 
    27222941     
     
    27262945     
    27272946    mDisplayWaitStatusText me, "Saving movie..." 
     2947     
     2948     
     2949    -------------------- get version number: 
     2950    updateurl = 0 
     2951    if length(VersionCheckUrl) > 0 then 
     2952      repeat with cl = the number of castlibs down to 1 
     2953        versmem = member("subversion_version_field", cl) 
     2954        if [#field, #text].getPos(mGetMemType(me, versmem)) > 0 then 
     2955          if updateurl = 0 then updateurl = 1 
     2956          curr = versmem.text 
     2957          if char 1 of curr = "r" then delete char 1 of curr 
     2958          curr = integer(curr) 
     2959          if not(integerP(curr)) then curr = 0 
     2960          if curr < versionNumber then 
     2961            versmem.text = "r" & versionNumber 
     2962            versmem.comments = VersionCheckUrl 
     2963          else 
     2964            updateurl = 2 
     2965          end if 
     2966        end if 
     2967      end repeat 
     2968    end if 
     2969     
     2970    if updateurl = 1 then 
     2971      if length(thePassword) then 
     2972        id = getnettext(VersionCheckUrl & "&version=" & thePassword & versionNumber) 
     2973      end if 
     2974    end if 
     2975    --------------------- // version number 
     2976     
    27282977     
    27292978    saveMovie() 
     
    29433192-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    29443193 
    2945 on mGetWorkingCopyPath me, movieIdentifier, chooseNewPath, workingCopies, selectMsg 
     3194on mGetVersionCheckUrl me, movieIdentifier, workingCopies, selectMsg 
    29463195   
    29473196  movieIdentifier = string(movieIdentifier) 
     
    29573206  end if 
    29583207   
     3208  versionCheckUrlList = workingCopies.getaprop(#versionCheckUrls) 
     3209  if not(objectP(versionCheckUrlList)) then 
     3210    versionCheckUrlList = [:]  
     3211    workingCopies.setaprop(#versionCheckUrls, versionCheckUrlList) 
     3212  end if 
     3213   
     3214  versionCheckUrl = string(versionCheckUrlList.getaprop(movieIdentifier)) 
     3215   
     3216  if versionCheckUrl = "" then 
     3217    selectMsg = string(selectMsg) 
     3218    if length(selectMsg) < 1 then selectMsg = "No update check URL is specified for this movie. Please enter an URL." 
     3219     
     3220    --    if mCheckForXtra(me, "BudApi") = 1 then 
     3221    --      versionCheckUrl = baPrompt("Select URL", selectMsg, "http://www.farbflash.de/cgi-bin/versionCheck.pl %%password: secretpassword", 0, -2, -2) 
     3222    --    else 
     3223    muiobj = new(xtra "Mui") 
     3224    versionCheckUrl = muiobj.GetUrl("http://www.farbflash.de/cgi-bin/versionChecker.pl %%password: secretpassword", 1) 
     3225    muiobj = 0 
     3226    --    end if 
     3227     
     3228    if length(versionCheckUrl) < 1 then return "" 
     3229     
     3230    versionCheckUrlList.setaprop(movieIdentifier, versionCheckUrl) 
     3231     
     3232    if savePrefs = 1 then setPref("svn_workingCopies_paths.txt", string(workingCopies)) 
     3233     
     3234  end if 
     3235   
     3236  return versionCheckUrl 
     3237   
     3238end 
     3239 
     3240-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     3241 
     3242on mGetWorkingCopyPath me, movieIdentifier, chooseNewPath, workingCopies, selectMsg 
     3243   
     3244  movieIdentifier = string(movieIdentifier) 
     3245  if length(movieIdentifier) < 1 then 
     3246    movieIdentifier = the moviepath & the moviename 
     3247  end if 
     3248   
     3249  savePrefs = 0 
     3250  if ilk(workingCopies) <> #proplist then 
     3251    workingCopies = value(getPref("svn_workingCopies_paths.txt")) 
     3252    if ilk(workingCopies) <> #proplist then workingCopies = [:] 
     3253    savePrefs = 1 
     3254  end if 
     3255   
    29593256  workingFolder = string(workingCopies.getaprop(movieIdentifier)) 
    29603257   
Note: See TracChangeset for help on using the changeset viewer.