Changeset 144 for trunk/lingosource
- Timestamp:
- 02/14/08 15:28:54 (4 years ago)
- File:
-
- 1 edited
-
trunk/lingosource/castlib1/svn_Utilities.ls (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lingosource/castlib1/svn_Utilities.ls
r136 r144 170 170 writeBack = 1 171 171 172 if convertLineBreaksToUnix = 1 then 173 ------------------------------------------ trac subversion support works better with unix linebreaks... 174 if mCheckForXtra(me, "Pregex") = 1 then 172 173 end if 174 175 176 ---------------------- windows 177 else 178 179 180 theResult = mDoShellCmd(me, QUOTE & bbdiffpath & QUOTE && QUOTE & tempSrcPath "E&"E& thePath "E, RETURN, 0, 0, 0) 181 182 -------- now write the results of the BBEdit diff back into the script members 183 scrText = mGetTextFromFile(me, tempSrcHFSPath) 184 185 writeBack = 1 186 end if 187 188 189 if writeBack = 1 then 190 191 192 if convertLineBreaksToUnix = 1 then 193 ------------------------------------------ trac subversion support works better with unix linebreaks... 194 if mCheckForXtra(me, "Pregex") = 1 then 195 196 scrTextLi = [scrText] 197 if the platform contains "mac" then 198 pregex_replace(scrTextLi, "\x0D?\x0A", "g", "\x0D") 199 else 200 pregex_replace(scrTextLi, "\x0D([^\x0A])", "g", "\x0D\x0A\1") 201 pregex_replace(scrTextLi, "([^\x0D])\x0A", "g", "\1\x0D\x0A") 202 end if 203 scrText = scrTextLi[1] 204 205 else 206 207 if the platform contains "mac" then 175 208 176 scrTextLi = [scrText] 177 if the platform contains "mac" then 178 pregex_replace(scrTextLi, "\x0D?\x0A", "g", "\x0D") 179 else 180 pregex_replace(scrTextLi, "\x0D([^\x0A])", "g", "\x0D\x0A\1") 181 pregex_replace(scrTextLi, "([^\x0D])\x0A", "g", "\1\x0D\x0A") 182 end if 183 scrText = scrTextLi[1] 209 -- first convert windows to mac 210 fndStr = numToChar(13) & numToChar(10) 211 offs = offset(fndStr, scrText) 212 repeat while offs > 0 213 put numToChar(13) into char offs to offs+1 of scrText 214 offs = offset(fndStr, scrText) 215 end repeat 216 217 -- now convert unix to mac 218 fndStr = numToChar(10) 219 offs = offset(fndStr, scrText) 220 repeat while offs > 0 221 put numToChar(13) into char offs of scrText 222 offs = offset(fndStr, scrText) 223 end repeat 184 224 185 225 else 186 226 187 if the platform contains "mac" then188 189 -- first convert windows to mac190 fndStr = numToChar(13) & numToChar(10)227 fndStr = numToChar(13) & numToChar(10) 228 offs = offset(fndStr, scrText) 229 repeat while offs > 0 230 put "ÀÀÀ" into char offs+1 of scrText 191 231 offs = offset(fndStr, scrText) 192 repeat while offs > 0193 put numToChar(13) into char offs to offs+1 of scrText194 offs = offset(fndStr, scrText)195 end repeat196 197 -- now convert unix to mac198 fndStr = numToChar(10)232 end repeat 233 234 235 fndStr = numToChar(10) 236 offs = offset(fndStr, scrText) 237 repeat while offs > 0 238 put "ÀÀÀ" into char offs of scrText 199 239 offs = offset(fndStr, scrText) 200 repeat while offs > 0201 put numToChar(13) into char offs of scrText202 offs = offset(fndStr, scrText)203 end repeat204 205 else206 207 fndStr = numToChar(13) & numToChar(10)240 end repeat 241 242 243 244 fndStr = numToChar(13) & "ÀÀÀ" 245 offs = offset(fndStr, scrText) 246 repeat while offs > 0 247 put numToChar(13) & numToChar(10) into char offs to offs+3 of scrText 208 248 offs = offset(fndStr, scrText) 209 repeat while offs > 0 210 put "ÀÀÀ" into char offs+1 of scrText 211 offs = offset(fndStr, scrText) 212 end repeat 213 214 215 fndStr = numToChar(10) 249 end repeat 250 251 252 253 fndStr = "ÀÀÀ" 254 offs = offset(fndStr, scrText) 255 repeat while offs > 0 256 put numToChar(13) & numToChar(10) into char offs to offs+2 of scrText 216 257 offs = offset(fndStr, scrText) 217 repeat while offs > 0 218 put "ÀÀÀ" into char offs of scrText 219 offs = offset(fndStr, scrText) 220 end repeat 221 222 223 224 fndStr = numToChar(13) & "ÀÀÀ" 225 offs = offset(fndStr, scrText) 226 repeat while offs > 0 227 put numToChar(13) & numToChar(10) into char offs to offs+3 of scrText 228 offs = offset(fndStr, scrText) 229 end repeat 230 231 232 233 fndStr = "ÀÀÀ" 234 offs = offset(fndStr, scrText) 235 repeat while offs > 0 236 put numToChar(13) & numToChar(10) into char offs to offs+2 of scrText 237 offs = offset(fndStr, scrText) 238 end repeat 239 240 end if 258 end repeat 241 259 242 260 end if 243 -----------------------------------------261 244 262 end if 245 246 247 263 ----------------------------------------- 248 264 end if 249 265 250 266 251 ---------------------- windows 252 else 253 254 255 theResult = mDoShellCmd(me, QUOTE & bbdiffpath & QUOTE && QUOTE & tempSrcPath "E&"E& thePath "E, RETURN, 0, 0, 0) 256 257 -------- now write the results of the BBEdit diff back into the script members 258 scrText = mGetTextFromFile(me, tempSrcHFSPath) 259 260 writeBack = 1 261 end if 262 263 264 if writeBack = 1 then 267 265 268 case memtype of 266 269
Note: See TracChangeset
for help on using the changeset viewer.
