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

Ignore:
Timestamp:
12/21/08 17:39:56 (3 years ago)
Author:
alex
Message:

added automatic deletion of members from subversion repository

File:
1 edited

Legend:

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

    r217 r221  
    356356            bbeditBinary = mFindUnixAppInPath(me, "bbedit") 
    357357            if length(bbeditBinary) > 0 then 
    358               mDoShellCmd(me, bbeditBinary && QUOTE & baUnixName(thePath) & QUOTE) 
     358              mDoShellCmd(me, bbeditBinary && QUOTE & mConvertHFS2Unix(me, thePath) & QUOTE) 
    359359              exit 
    360360            end if 
     
    541541  DirectImageInstance = 0 
    542542  if skipIcons <> 1 then 
    543     if mCheckForXtra(me, "DirectImage") = 1 then 
    544       if the platform contains "mac" then 
    545         DirectImageInstance = new(xtra "DirectImage", 234521832) 
    546       else 
    547         DirectImageInstance = new(xtra "DirectImage", 228285877) 
    548       end if 
    549     else if mCheckForXtra(me, "SharpExport") = 1 then 
     543    if mCheckForXtra(me, "SharpExport") = 1 then 
    550544      SharpExportInst = new(xtra "SharpExport") 
    551545    else 
     
    557551  isMac = (the platform contains "mac") -- we need the differentiation because of the dreaded 31 char limit 
    558552   
     553  ----------------------- 
     554  resetUNames = 0 
     555  if isMac then 
     556    if baSysFolder("prefs") starts "/" then 
     557      baReturnUnixNames(0) 
     558      resetUNames = 1 
     559    end if 
     560  end if 
     561  ----------------------- 
     562   
    559563  doit = 0 
    560564   
    561    
    562565  statusSwitched = mSwitchToStatusMode(me, 1) 
    563566   
    564567  repeat with m = firstCastNum to lastCastNum 
     568     
     569    listOfAllFiles = ["memberinfo"] 
    565570     
    566571    thisFolder = theFolder & "castlib" & m 
     
    680685             
    681686            if memref <> member(theDefaultName, m) then 
    682               put "Member" && memref && "is duplicate. Member with duplicate names are not supported" 
     687              put "Member" && memref && "is duplicate. Member with duplicate names are not supported. (Can't have the same file twice in one folder.)" 
    683688              next repeat 
    684689            end if 
     
    743748            snam = baShortFileName(thisFolder & origname & ext) 
    744749            if length(snam) > 0 then 
     750              -- alterText = mGetTextFromFile(me, thisFolder & origname & ext) 
     751              alterText = mGetTextFromFile(me, snam) 
     752            else 
    745753              alterText = mGetTextFromFile(me, thisFolder & origname & ext) 
    746754            end if 
     
    749757          end if 
    750758           
     759          listOfAllFiles.add(mLowerCase(me, origname)) 
     760           
    751761          if alterText <> scrText then 
    752762             
     
    758768               
    759769              mSaveToTextFile me, scrText, thisFolder & theDefaultName & ext 
     770               
     771               
    760772               
    761773              bmexp = 0 
     
    826838     
    827839     
     840    ----------------------- 
     841    if isMac then baReturnUnixNames(1) 
     842    ----------------------- 
     843     
     844    flist = baFileList(thisFolder, "*.*") 
     845     
     846     
     847    --    put "flist =" && flist 
     848    --    put "listOfAllFiles =" && listOfAllFiles 
     849    repeat with thisFile in flist 
     850      split = mSplitPath(me, thisFile) 
     851      if listOfAllFiles.getPos(mLowerCase(me, split[#basename])) < 1 then 
     852        if isMac then 
     853          erg = baDeleteFile(mConvertHFS2Unix(me, thisFolder & thisFile)) 
     854        else 
     855          erg = baDeleteFile(thisFolder & thisFile) 
     856        end if 
     857        if erg = 1 then 
     858          put "Deleted file" && thisFolder & thisFile 
     859        else 
     860          put "Unable to delete file" && thisFolder & thisFile 
     861        end if 
     862      end if 
     863    end repeat 
     864     
     865    ----------------------- 
     866    if isMac then baReturnUnixNames(0) 
     867    ----------------------- 
     868     
     869     
    828870  end repeat 
     871   
     872  if resetUNames = 1 then baReturnUnixNames(1) 
    829873   
    830874  DirectImageInstance = 0 
     
    15571601-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    15581602 
    1559 on mSVN_Update_Working_Copy_ScriptText me, chooseNewPath 
     1603on mSVN_Update_Working_Copy_ScriptText me, revisionNumber, chooseNewPath, selectionList, dontShowAlert 
    15601604   
    15611605  workingCopies = value(getPref("svn_workingCopies_paths.txt")) 
     
    15691613   
    15701614  if the platform contains "mac" then 
    1571     svnBinary = baUnixName(svnBinary) 
    1572     workingFolder = baUnixName(workingFolder) 
     1615    svnBinary = mConvertHFS2Unix(me, svnBinary) 
     1616    workingFolder = mConvertHFS2Unix(me, workingFolder) 
    15731617  else 
    15741618    if the last char of workingFolder = the last char of the applicationpath then delete the last char of workingFolder 
     
    15781622  mDisplayWaitStatusText me, "Updating folder:" && workingFolder 
    15791623   
    1580   theresult = mDoShellCmd(me, svnBinary && "update" && QUOTE & workingFolder & QUOTE, RETURN, 0, 1) 
     1624   
     1625  revisionNumber = getValidRevNumber(me, revisionNumber) 
     1626   
     1627  castlibList = getCastlibList(me, selectionList) 
     1628   
     1629  if count(castlibList) < 1 then 
     1630    theresult = mDoShellCmd(me, svnBinary && "update" && QUOTE & workingFolder & QUOTE, RETURN, 0, 1) 
     1631     
     1632  else 
     1633     
     1634    theresult = [] 
     1635    repeat with num in castlibList 
     1636       
     1637      if the platform contains "mac" then thePath = workingFolder & "castlib" & num & "/" 
     1638      else thePath = workingFolder & "castlib" & num & the last char of the moviepath 
     1639       
     1640      ret = mDoShellCmd(me, svnBinary && "update" && "-r" && revisionNumber && QUOTE & thePath & QUOTE, RETURN, 0, 1) 
     1641      if count(ret) > 0 then theresult.add(ret[1]) 
     1642       
     1643    end repeat 
     1644     
     1645  end if 
    15811646   
    15821647  if statusSwitched = 1 then statusSwitched = mSwitchToStatusMode(me, 0) 
    15831648   
    15841649  if count(theresult) > 0 then 
    1585     put theresult[1] 
    1586     alert "Done, see the results of the svn operation in the message window." 
     1650    repeat with n = 1 to count(theresult) 
     1651      put theresult[n] 
     1652    end repeat 
     1653    if dontShowAlert <> 1 then 
     1654      alert "Done, see the results of the svn operation in the message window." 
     1655    end if 
    15871656  else 
    1588     alert "svn application did not respond, something seems to have failed. :-(" 
     1657    if dontShowAlert <> 1 then 
     1658      alert "svn application did not respond, something seems to have failed. :-(" 
     1659    end if 
    15891660  end if 
    15901661   
     
    15931664end 
    15941665 
     1666-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     1667 
     1668on getValidRevNumber me, revisionNumber 
     1669  if integerP(integer(revisionNumber)) then return string(revisionNumber) 
     1670   
     1671  revisionNumber = string(revisionNumber) 
     1672  if length(revisionNumber) < 1 then 
     1673    revisionNumber = "HEAD" 
     1674  else 
     1675    if char 1 of revisionNumber = "'" then delete char 1 of revisionNumber 
     1676    if the last char of revisionNumber = "'" then delete the last char of revisionNumber 
     1677  end if 
     1678   
     1679  return QUOTE & revisionNumber & QUOTE 
     1680end 
    15951681 
    15961682-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     
    16111697  if the platform contains "mac" then 
    16121698    isMac = 1 
    1613     svnBinary = baUnixName(svnBinary) 
     1699    svnBinary = mConvertHFS2Unix(me, svnBinary) 
    16141700     
    16151701  else 
     
    17371823               
    17381824              if isMac = 1 then 
    1739                 ufpath =  baUnixName(fpath) 
     1825                ufpath =  mConvertHFS2Unix(me, fpath) 
    17401826              else 
    17411827                ufpath =  fpath 
     
    17971883     
    17981884    if isMac = 1 then 
    1799       workingFolder = baUnixName(workingFolder) 
     1885      workingFolder = mConvertHFS2Unix(me, workingFolder) 
    18001886    else 
    18011887      if the last char of workingFolder = the last char of the applicationpath then delete the last char of workingFolder 
     
    18981984   
    18991985   
    1900   castlibList = 0 
    1901   selectionList = string(selectionList) 
    1902   if length(selectionList) > 0 then 
    1903     if char 1 of selectionList <> "[" then put "[" before selectionList 
    1904     if the last char of selectionList <> "]" then put "]" after selectionList 
    1905     selectionList = value(selectionList) 
    1906     if listP(selectionList) then 
    1907       clnum = the number of castlibs + 1 
    1908       castlibList = [] 
    1909       selectionListCnt = count(selectionList) 
    1910       repeat with n = 1 to selectionListCnt 
    1911         int = integer(selectionList[n]) 
    1912         if integerP(int) then 
    1913           if clnum > int then 
    1914             if castlibList.getPos(int) < 1 then castlibList.add(int) 
    1915           end if 
    1916         end if 
    1917       end repeat 
    1918     end if 
    1919   end if 
    1920    
    1921   if castlibList = 0 then 
    1922     castlibList = [] 
    1923     actCL = the activecastlib 
    1924     castlibList.add(actCL) 
    1925   end if 
    1926    
     1986  castlibList = getCastlibList(me, selectionList, the activecastlib) 
    19271987   
    19281988  mpname = the moviepath & the moviename 
     
    19892049    -------------------- get version number: 
    19902050    if the platform contains "mac" then 
    1991       svnBin = baUnixName(svnBinary) 
    1992       workFolder = baUnixName(workingFolder) 
     2051      svnBin = mConvertHFS2Unix(me, svnBinary) 
     2052      workFolder = mConvertHFS2Unix(me, workingFolder) 
    19932053    else 
    19942054      workFolder = workingFolder 
     
    20922152        offs = offset(mp, fname) 
    20932153        if offs <> 1 then 
    2094           alert "Castlib" && castlib(actCL) && "is not within your current moviepath. This is not supported." 
     2154          alert "Castlib" && castlib(cl) && "is not within your current moviepath. This is not supported." 
    20952155          if statusSwitched = 1 then statusSwitched = mSwitchToStatusMode(me, 0) 
    20962156          return 0 
     
    21042164        delete the last item of newpathDir 
    21052165        if baFolderExists(newpathDir) <> 1 then baCreateFolder(newpathDir) 
    2106         baCopyFileProgress(fname, newpath, "Always", "Copying castlib " & actCL & " to working folder", "", 33) 
     2166        baCopyFileProgress(fname, newpath, "Always", "Copying castlib " & cl & " to working folder", "", 33) 
    21072167         
    21082168        castlibList[r] = [cl, fname, newpath, newpathDir] 
     
    21372197  --------------------------------------- 
    21382198  if the platform contains "mac" then 
    2139     svnBinary = baUnixName(svnBinary) 
    2140     workingFolder = baUnixName(workingFolder) 
     2199    svnBinary = mConvertHFS2Unix(me, svnBinary) 
     2200    workingFolder = mConvertHFS2Unix(me, workingFolder) 
    21412201     
    21422202    castlibListCnt = count(castlibList) 
    21432203    repeat with r = 1 to castlibListCnt 
    2144       castlibList[r][3] = baUnixName(castlibList[r][3]) 
     2204      castlibList[r][3] = mConvertHFS2Unix(me, castlibList[r][3]) 
    21452205    end repeat 
    21462206     
     
    22722332    -------------------- get version number: 
    22732333    if the platform contains "mac" then 
    2274       svnBin = baUnixName(svnBinary) 
    2275       workFolder = baUnixName(workingFolder) 
     2334      svnBin = mConvertHFS2Unix(me, svnBinary) 
     2335      workFolder = mConvertHFS2Unix(me, workingFolder) 
    22762336    else 
    22772337      workFolder = workingFolder 
     
    23882448  --------------------------------------- 
    23892449  if the platform contains "mac" then 
    2390     svnBinary = baUnixName(svnBinary) 
    2391     workingFolder = baUnixName(workingFolder) 
     2450    svnBinary = mConvertHFS2Unix(me, svnBinary) 
     2451    workingFolder = mConvertHFS2Unix(me, workingFolder) 
    23922452  else 
    23932453    if the last char of workingFolder = the last char of the applicationpath then delete the last char of workingFolder 
     
    24862546-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    24872547 
    2488 on mSVN_Update_SelectedCastlib me, chooseNewPath, onlyUpdate_SVN_WorkingFolder, selectionList, revisionNumber, dontShowAlert 
    2489    
    2490   actCL = the activecastlib 
    2491   castlibList = [actCL] 
     2548on mSVN_Update_SelectedCastlib_and_source me, chooseNewPath, onlyUpdate_SVN_WorkingFolder, selectionList, revisionNumber, dontShowAlert 
     2549  mSVN_Update_Working_Copy_ScriptText me, revisionNumber, void, selectionList, 1 
     2550  mSVN_Update_SelectedCastlib me, chooseNewPath, onlyUpdate_SVN_WorkingFolder, selectionList, revisionNumber, dontShowAlert 
     2551end 
     2552 
     2553-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     2554 
     2555on getCastlibList me, selectionList, defaultCLNum 
     2556   
     2557  castlibList = 0 
    24922558   
    24932559  selectionList = string(selectionList) 
    24942560  if length(selectionList) > 0 then 
     2561     
     2562    offs = offset("'", selectionList) 
     2563    repeat while offs > 0 
     2564      put QUOTE into char offs of selectionList 
     2565      offs = offset("'", selectionList) 
     2566    end repeat 
    24952567     
    24962568    if char 1 of selectionList <> "[" then put "[" before selectionList 
     
    25032575      selectionListCnt = count(selectionList) 
    25042576      repeat with n = 1 to selectionListCnt 
    2505         int = integer(selectionList[n]) 
    2506         if integerP(int) then 
    2507           if clnum > int then 
    2508             if castlibList.getPos(int) < 1 then castlibList.add(int) 
     2577         
     2578        cl = castlib(selectionList[n]) 
     2579        if ilk(cl) = #castlib then 
     2580          int = cl.number 
     2581          if castlibList.getPos(int) < 1 then 
     2582            castlibList.add(int) 
     2583          end if 
     2584        else 
     2585          int = integer(selectionList[n]) 
     2586          if integerP(int) then 
     2587            if clnum > int then 
     2588              if castlibList.getPos(int) < 1 then castlibList.add(int) 
     2589            end if 
    25092590          end if 
    25102591        end if 
     
    25122593    end if 
    25132594  end if 
     2595   
     2596  if not(listP(castlibList)) then castlibList = [] 
     2597   
     2598  if count(castlibList) < 1 then 
     2599    if ilk(defaultCLNum) = #integer then 
     2600      castlibList.add(defaultCLNum) 
     2601    else if listP(defaultCLNum) then 
     2602      castlibList = defaultCLNum 
     2603    end if 
     2604  end if 
     2605   
     2606  return castlibList 
     2607end 
     2608 
     2609-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     2610 
     2611on mSVN_Update_SelectedCastlib me, chooseNewPath, onlyUpdate_SVN_WorkingFolder, selectionList, revisionNumber, dontShowAlert 
     2612   
     2613  castlibList = getCastlibList(me, selectionList, the activecastlib) 
    25142614   
    25152615  if count(castlibList) < 1 then 
     
    25682668         
    25692669        if isMac then 
    2570           castlibPathList.add([#newpath:newpath, #newpathUnix: baUnixName(newpath), #fname:fname]) 
     2670          castlibPathList.add([#newpath:newpath, #newpathUnix: mConvertHFS2Unix(me, newpath), #fname:fname]) 
    25712671        else 
    25722672          castlibPathList.add([#newpath:newpath, #newpathUnix: newpath, #fname:fname]) 
     
    25902690      newpath = fname 
    25912691      if isMac then 
    2592         castlibPathList.add([#newpath:newpath, #newpathUnix: baUnixName(newpath), #fname:fname]) 
     2692        castlibPathList.add([#newpath:newpath, #newpathUnix: mConvertHFS2Unix(me, newpath), #fname:fname]) 
    25932693      else 
    25942694        castlibPathList.add([#newpath:newpath, #newpathUnix: newpath, #fname:fname]) 
     
    26222722   
    26232723  if the platform contains "mac" then 
    2624     svnBinary = baUnixName(svnBinary) 
    2625     workingFolderUnix = baUnixName(workingFolder) 
     2724    svnBinary = mConvertHFS2Unix(me, svnBinary) 
     2725    workingFolderUnix = mConvertHFS2Unix(me, workingFolder) 
    26262726    -- newpathUnix = baUnixName(newpath) 
    26272727  else 
     
    26342734  mDisplayWaitStatusText me, "SVN update..." -- && newpathUnix 
    26352735   
    2636   if integerP(integer(revisionNumber)) then 
    2637     revisionNumber = string(revisionNumber) 
    2638   else 
    2639     revisionNumber = string(revisionNumber) 
    2640     if length(revisionNumber) < 1 then 
    2641       revisionNumber = "HEAD" 
    2642     else 
    2643       if char 1 of revisionNumber = "'" then delete char 1 of revisionNumber 
    2644       if the last char of revisionNumber = "'" then delete the last char of revisionNumber 
    2645     end if 
    2646     revisionNumber = QUOTE & revisionNumber & QUOTE 
    2647   end if 
    2648    
     2736   
     2737  revisionNumber = getValidRevNumber(me, revisionNumber) 
    26492738   
    26502739  repeat with castlibPaths in castlibPathList 
     
    27272816   
    27282817   
     2818  oldmoviepath = the moviepath 
     2819  oldmovie = oldmoviepath & the moviename 
     2820   
     2821   
    27292822  if the platform contains "mac" then 
    2730     svnBinary = baUnixName(svnBinary) 
    2731     workingFolderUnix = baUnixName(workingFolder) 
     2823     
     2824    if the platform contains "mac" then 
     2825      if not(interface(xtra "budapi") contains "baUnixName") then 
     2826        alert "Please update your copy of the buddyApi xtra to the latest version, baUnixName() is missing." 
     2827        exit 
     2828      end if 
     2829    end if 
     2830     
     2831     
     2832    svnBinary = mConvertHFS2Unix(me, svnBinary) 
     2833    workingFolderUnix = mConvertHFS2Unix(me, workingFolder) 
     2834    targetPath = mConvertHFS2Unix(me, oldmoviepath) 
     2835     
     2836    theDelim = "/" 
     2837    if the last char of targetPath = theDelim then delete the last char of targetPath 
     2838    if the last char of workingFolderUnix = theDelim then delete the last char of workingFolderUnix 
     2839     
    27322840  else 
    27332841    workingFolderUnix = workingFolder 
    2734     if the last char of workingFolderUnix = the last char of the applicationpath then delete the last char of workingFolderUnix 
    2735   end if 
    2736    
    2737   oldmoviepath = the moviepath 
    2738   oldmovie = oldmoviepath & the moviename 
     2842    targetPath = oldmoviepath 
     2843    theDelim = the last char of the applicationpath 
     2844    if the last char of workingFolderUnix = theDelim then delete the last char of workingFolderUnix 
     2845    if the last char of targetPath = theDelim then delete the last char of targetPath 
     2846  end if 
     2847   
    27392848   
    27402849   
     
    27582867  mDisplayWaitStatusText me, "SVN update:" && workingFolderUnix 
    27592868   
    2760   if integerP(integer(revisionNumber)) then 
    2761     revisionNumber = string(revisionNumber) 
    2762   else 
    2763     revisionNumber = string(revisionNumber) 
    2764     if length(revisionNumber) < 1 then 
    2765       revisionNumber = "HEAD" 
    2766     else 
    2767       if char 1 of revisionNumber = "'" then delete char 1 of revisionNumber 
    2768       if the last char of revisionNumber = "'" then delete the last char of revisionNumber 
    2769     end if 
    2770     revisionNumber = QUOTE & revisionNumber & QUOTE 
    2771   end if 
     2869  revisionNumber = getValidRevNumber(me, revisionNumber) 
    27722870   
    27732871  theresult = mDoShellCmd(me, svnBinary && "update" && "-r" && revisionNumber && QUOTE & workingFolderUnix & QUOTE, RETURN, 0, 1) 
     
    27882886         
    27892887        put "Copy files from " & workingFolder & " to " & oldmoviepath 
    2790         mCopyAllFiles(me, workingFolder, oldmoviepath) 
     2888         
     2889        --        mCopyAllFiles(me, workingFolder, oldmoviepath, theresult) 
     2890         
     2891        mCopyAllFiles(me, workingFolder, oldmoviepath, theresult, workingFolderUnix, targetPath) 
    27912892         
    27922893        ---------------------------------- 
     
    27992900     
    28002901    if doReturnToOldMovie = 1 then 
    2801      --  put RETURN & "go to movie" && oldmovie & RETURN 
     2902      --  put RETURN & "go to movie" && oldmovie & RETURN 
    28022903      go to movie oldmovie 
    28032904    end if 
     
    28222923-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    28232924 
    2824 on mCopyAllFiles me, fromFolder, toFolder 
    2825    
    2826   flist = baFolderList(fromFolder) 
    2827   flistCnt = count(flist) 
    2828   repeat with n = flistCnt down to 1 
    2829     thisFolder = flist[n] 
    2830     if thisFolder starts ".svn" then next repeat 
    2831     if not(baFolderExists(toFolder & thisFolder)) then 
    2832       put "Attempting to create folder:" && toFolder & thisFolder 
    2833       erg = baCreateFolder(toFolder & thisFolder) 
    2834        
    2835       if erg = 0 then put "successfully created folder" 
    2836       else put "Unable to create folder." 
    2837        
    2838     else 
    2839       erg = 1 
    2840     end if 
    2841      
    2842     if erg = 1 then 
    2843       mCopyAllFiles me, fromFolder & thisFolder & the last char of toFolder, toFolder & thisFolder & the last char of toFolder 
    2844     else 
    2845       alert "Unable to create folder (" & thisFolder & "). Error:" && erg 
    2846     end if 
    2847      
    2848   end repeat 
    2849    
    2850   flist = baFileList(fromFolder, "*.*") 
    2851   flistCnt = count(flist) 
    2852   repeat with n = 1 to flistCnt 
    2853     thisFile = flist[n] 
    2854     if thisFile starts ".svn" then next repeat 
    2855     -- we get ourselves only dir and cast files: 
    2856     len = length(thisFile) 
    2857     ext = thisFile.char[len-3 .. len] 
    2858     if ext = ".dir" or ext = ".cst" then 
    2859       erg = baCopyFileProgress(fromFolder & thisFile, toFolder & thisFile, "Always", "Replacing movie with the version of the working folder", "", 33) 
    2860       if erg <> 0 then 
    2861         alert "An error occurred during copying the file (" & thisFile & "). Error:" && erg 
     2925on mCopyAllFiles me, fromFolder, toFolder, listOfChangedFiles, fromFolderUnix, toFolderUnix 
     2926   
     2927  if the platform contains "mac" then 
     2928    if not(interface(xtra "budapi") contains "baReturnUnixNames") then 
     2929      alert "Please update your copy of the buddyApi xtra to the latest version, baReturnUnixNames() is missing." 
     2930      listOfChangedFiles = 0 
     2931    end if 
     2932  end if 
     2933   
     2934  if listP(listOfChangedFiles) then -- we have a list with status messages from svn for each file 
     2935     
     2936    resetUNames = 0 
     2937    if the platform contains "mac" then 
     2938      if not(baSysFolder("prefs") starts "/") then 
     2939        baReturnUnixNames(1) 
     2940        resetUNames = 1 
     2941      end if 
     2942    end if 
     2943     
     2944    repeat with thisFile in listOfChangedFiles 
     2945      if char 2 of thisFile = " " then 
     2946        action = char 1 of thisFile 
     2947        delete char 1 of thisFile 
     2948        repeat while char 1 of thisFile = " " 
     2949          delete char 1 of thisFile 
     2950          if length(thisFile) < 1 then exit repeat 
     2951        end repeat 
     2952        if length(thisFile) > 0 then 
     2953          offs = offset(fromFolderUnix, thisFile) 
     2954          if offs = 1 then 
     2955            case action of 
     2956              "D": -- deleted 
     2957                erg = baDeleteFile(toFolderUnix & thisFile) 
     2958                 
     2959                if erg <> 1 then 
     2960                  alert "An error occurred during deleting the file (" & toFolderUnix & thisFile & "). Error:" && erg 
     2961                else 
     2962                  put "Delted file:" && toFolderUnix & thisFile 
     2963                end if 
     2964                 
     2965              "U", "A": -- updated, added 
     2966                delete char 1 to length(fromFolderUnix) of thisFile 
     2967                erg = baCopyFileProgress(fromFolderUnix & thisFile, toFolderUnix & thisFile, "Always", "Replacing file " & thisFile & " with the version of the working folder", "", 33) 
     2968                 
     2969                if erg <> 0 then 
     2970                  alert "An error occurred during copying the file (" & thisFile & "). Error:" && erg 
     2971                else 
     2972                  put "Replaced file:" && thisFile 
     2973                end if 
     2974                 
     2975            end case 
     2976          else 
     2977            put "Couldn't copy file" && thisFile && "as it doesn't seem to be in the current path:" && fromFolderUnix 
     2978          end if 
     2979           
     2980        end if 
     2981      end if 
     2982    end repeat 
     2983     
     2984    if resetUNames = 1 then baReturnUnixNames(0) 
     2985     
     2986  else -- no list? we just copy over all .dir and .cst and .ls files 
     2987     
     2988    flist = baFolderList(fromFolder) 
     2989    flistCnt = count(flist) 
     2990    repeat with n = flistCnt down to 1 
     2991      thisFolder = flist[n] 
     2992      if thisFolder starts ".svn" then next repeat 
     2993      if not(baFolderExists(toFolder & thisFolder)) then 
     2994        put "Attempting to create folder:" && toFolder & thisFolder 
     2995        erg = baCreateFolder(toFolder & thisFolder) 
     2996         
     2997        if erg = 0 then put "successfully created folder" 
     2998        else put "Unable to create folder." 
     2999         
    28623000      else 
    2863         put "Replaced file:" && thisFile 
     3001        erg = 1 
    28643002      end if 
    2865     end if 
    2866   end repeat 
    2867    
     3003       
     3004      if erg = 1 then 
     3005        mCopyAllFiles me, fromFolder & thisFolder & the last char of toFolder, toFolder & thisFolder & the last char of toFolder 
     3006      else 
     3007        alert "Unable to create folder (" & thisFolder & "). Error:" && erg 
     3008      end if 
     3009       
     3010    end repeat 
     3011     
     3012    flist = baFileList(fromFolder, "*.*") 
     3013    flistCnt = count(flist) 
     3014    repeat with n = 1 to flistCnt 
     3015      thisFile = flist[n] 
     3016      if thisFile starts ".svn" then next repeat 
     3017      -- we get ourselves only dir and cast files: 
     3018      len = length(thisFile) 
     3019      ext = thisFile.char[len-3 .. len] 
     3020      if ext = ".dir" or ext = ".cst" or ext = ".ls" then 
     3021        erg = baCopyFileProgress(fromFolder & thisFile, toFolder & thisFile, "Always", "Replacing movie with the version of the working folder", "", 33) 
     3022        if erg <> 0 then 
     3023          alert "An error occurred during copying the file (" & thisFile & "). Error:" && erg 
     3024        else 
     3025          put "Replaced file:" && thisFile 
     3026        end if 
     3027      end if 
     3028    end repeat 
     3029     
     3030  end if 
    28683031end 
    28693032 
     
    29183081   
    29193082  if the platform contains "mac" then 
    2920     svnBin = baUnixName(svnBinary) 
    2921     workFolder = baUnixName(workingFolder) 
     3083    svnBin = mConvertHFS2Unix(me, svnBinary) 
     3084    workFolder = mConvertHFS2Unix(me, workingFolder) 
    29223085  else 
    29233086    workFolder = workingFolder 
     
    29623125     
    29633126    ----------------------------------------------------- 
    2964      
    2965     selectionList = string(selectionList) 
    2966     if length(selectionList) > 0 then 
    2967        
    2968       if char 1 of selectionList <> "[" then put "[" before selectionList 
    2969       if the last char of selectionList <> "]" then put "]" after selectionList 
    2970        
    2971       selectionList = value(selectionList) 
    2972       if listP(selectionList) then 
    2973         clnum = the number of castlibs + 1 
    2974         castlibList = [] 
    2975         selectionListCnt = count(selectionList) 
    2976         repeat with n = 1 to selectionListCnt 
    2977           int = integer(selectionList[n]) 
    2978           if integerP(int) then 
    2979             if clnum > int then 
    2980               if castlibList.getPos(int) < 1 then castlibList.add(int) 
    2981             end if 
    2982           end if 
    2983         end repeat 
    2984       end if 
    2985     end if 
    2986      
    2987     if castlibList = 0 then 
    2988       castlibList = [] 
    2989       castlibList.add(selected_Members_Only.number) 
    2990     end if 
     3127    processIOnlySelectedMembers = 1 
     3128    clsellist = string(selectionList) 
     3129    if length(clsellist) > 0 then 
     3130      if listP(value(clsellist)) then processIOnlySelectedMembers = 0 
     3131    end if 
     3132    castlibList = getCastlibList(me, selectionList, selected_Members_Only.number) 
    29913133     
    29923134     
     
    30073149    end if 
    30083150     
    3009      
    3010      
    3011     mDisplayWaitStatusText me, "Commiting scripttext for castlibs:" && castlibList 
    3012      
    3013     put "Commiting scripttext for castlibs:" && castlibList 
    30143151    ----------------------------------------------------- 
    30153152     
     
    30243161       
    30253162      selected_Members_Only = castlib(castlibList[n]) 
    3026        
    3027       mDisplayWaitStatusText me, "Saving castlib:" && selected_Members_Only 
    3028        
    30293163       
    30303164      -------------------- get version number: 
     
    30513185       
    30523186       
    3053       selected_Members_Only.save() 
    3054        
    30553187      if the last item of workingFolder = "castlib" & selected_Members_Only.number then 
    30563188        clibfolder = workingFolder 
     
    30633195      -------- 
    30643196       
    3065        
    3066       mExportAllScriptsToDiskWithFolder me, 1, selected_Members_Only, 1, workingFolder 
    30673197       
    30683198    end repeat 
     
    30843214  else -- treat all: 
    30853215     
    3086     mDisplayWaitStatusText me, "Saving movie..." 
    3087      
     3216    processIOnlySelectedMembers = 0 
    30883217     
    30893218    -------------------- get version number: 
     
    31193248     
    31203249     
    3121     saveMovie() 
    3122      
    3123     mExportAllScriptsToDiskWithFolder me, 1, selected_Members_Only, 1, workingFolder 
    3124      
    31253250    castlibList = 0 
    31263251     
     
    31283253   
    31293254   
     3255  workingFolderOriginal = workingFolder 
    31303256   
    31313257  if castlibList = 0 then 
     
    31353261    -------- 
    31363262     
    3137      
    31383263    if the platform contains "mac" then 
    3139       svnBinary = baUnixName(svnBinary) 
    3140       workingFolder = baUnixName(workingFolder) 
     3264      svnBinary = mConvertHFS2Unix(me, svnBinary) 
     3265      workingFolder = mConvertHFS2Unix(me, workingFolder) 
    31413266    else 
    31423267      if the last char of workingFolder = the last char of the applicationpath then delete the last char of workingFolder 
     
    31483273  else 
    31493274     
    3150     if the platform contains "mac" then svnBinary = baUnixName(svnBinary) 
     3275    if the platform contains "mac" then svnBinary = mConvertHFS2Unix(me, svnBinary) 
    31513276    cnt = count(castlibList) 
    31523277     
     
    31563281       
    31573282      if the platform contains "mac" then 
    3158         castlibList[n][3] = baUnixName(castlibList[n][3]) 
     3283        castlibList[n][3] = mConvertHFS2Unix(me, castlibList[n][3]) 
    31593284      else 
    31603285        str = castlibList[n][3] 
     
    31903315  end if 
    31913316   
     3317   
     3318   
     3319  -------- if we work on only one castlib: 
     3320   
     3321  if ilk(selected_Members_Only) = #castLib then 
     3322     
     3323    mDisplayWaitStatusText me, "Commiting scripttext for castlibs:" && castlibList 
     3324    put "Commiting scripttext for castlibs:" && castlibList 
     3325    repeat with n = count(castlibList) down to 1 
     3326       
     3327      selected_Members_Only = castlib(castlibList[n][1]) 
     3328      if processIOnlySelectedMembers = 0 then processEntireCastlib = selected_Members_Only 
     3329      else processEntireCastlib = 1 
     3330      mDisplayWaitStatusText me, "Saving castlib:" && selected_Members_Only 
     3331      selected_Members_Only.save() 
     3332      mExportAllScriptsToDiskWithFolder me, 1, processEntireCastlib, 1, mConvertUnix2Hfs(me, castlibList[n][3]) 
     3333       
     3334    end repeat 
     3335     
     3336  else -- treat all: 
     3337     
     3338    mDisplayWaitStatusText me, "Saving movie..." 
     3339    saveMovie() 
     3340    mExportAllScriptsToDiskWithFolder me, 1, processIOnlySelectedMembers, 1, workingFolderOriginal 
     3341     
     3342  end if 
     3343   
     3344   
    31923345  theresult = mDoShellCmd(me, svnBinary && "status" & workingFolder, RETURN, 0, 1) 
    31933346   
     
    32063359    case meth of 
    32073360      "!": -- deleted file (missing here, but in the repository present) 
    3208         -- I don't think, it is a good idea to delete the file in the repository in this case 
    3209         -- as it may also be the case, that we only have a subset of the castlibs/scripts 
    3210         -- therefore I just skip these files and leave it to the user what to do with them in his svn client application 
    3211         -- we only put a message, so the user is made aware of this fact 
    3212         put "Missing file!" && answ && "is missing here, but present in the repository" 
    3213          
    3214         mDisplayWaitStatusText me, "Missing file!" && answ && "is missing here, but present in the repository" 
     3361         
     3362        if processIOnlySelectedMembers = 1 then 
     3363          -- I don't think, it is a good idea to delete the file in the repository in this case 
     3364          -- as it may also be the case, that we only have a subset of the castlibs/scripts 
     3365          -- therefore I just skip these files and leave it to the user what to do with them in his svn client application 
     3366          -- we only put a message, so the user is made aware of this fact 
     3367          put "Missing file!" && answ && "is missing here, but present in the repository" 
     3368           
     3369          mDisplayWaitStatusText me, "Missing file!" && answ && "is missing here, but present in the repository" 
     3370           
     3371        else 
     3372           
     3373          mDoShellCmd(me, svnBinary && "rm" && QUOTE & answ & QUOTE, RETURN, 0, 1) 
     3374           
     3375          put "Deleted file" && answ && "in the repository" 
     3376           
     3377          mDisplayWaitStatusText me, "Deleted file" && answ && "in the repository" 
     3378           
     3379        end if 
    32153380         
    32163381         
Note: See TracChangeset for help on using the changeset viewer.