equal
deleted
inserted
replaced
5325 "/ |
5325 "/ |
5326 "/ if there is no SourceCodeManager, |
5326 "/ if there is no SourceCodeManager, |
5327 "/ or TryLocalSourceFirst is true, |
5327 "/ or TryLocalSourceFirst is true, |
5328 "/ look in standard places first |
5328 "/ look in standard places first |
5329 "/ |
5329 "/ |
5330 "JV@2011-12-08: |
5330 "JV@2011-12-08: |
5331 (i) first check TryLocalSourceFirst, this avoids useless call to |
5331 (i) first check TryLocalSourceFirst, this avoids useless call to |
5332 #sourceCodeManagerFromBinaryRevision when TryLocalSourceFirst is |
5332 #sourceCodeManagerFromBinaryRevision when TryLocalSourceFirst is |
5333 set (for whatever reason) |
5333 set (for whatever reason) |
5334 (ii) do NOT ask source code manager during system startup - source code |
5334 (ii) do NOT ask source code manager during system startup - source code |
5335 managers are not configured anyway!! Also, avoids hangups during |
5335 managers are not configured anyway!! Also, avoids hangups during |
5339 used, compilation may fail. However, it may happen anyway as SCM's |
5339 used, compilation may fail. However, it may happen anyway as SCM's |
5340 are not yet configured so the system may use wrong one. Moreover, |
5340 are not yet configured so the system may use wrong one. Moreover, |
5341 the source from which the class is compiled may not be the one in |
5341 the source from which the class is compiled may not be the one in |
5342 repository. I (JV) think this is a good, less confusing compromise. |
5342 repository. I (JV) think this is a good, less confusing compromise. |
5343 " |
5343 " |
5344 (TryLocalSourceFirst == true |
5344 (TryLocalSourceFirst == true |
5345 or:[Smalltalk isInitialized not |
5345 or:[Smalltalk isInitialized not |
5346 or: [(sourceCodeManager := self sourceCodeManagerFromBinaryRevision) isNil]]) |
5346 or: [(sourceCodeManager := self sourceCodeManagerFromBinaryRevision) isNil]]) |
5347 ifTrue:[ |
5347 ifTrue:[ |
5348 sourceStream := self localSourceStreamFor:source. |
5348 sourceStream := self localSourceStreamFor:source. |
5349 ]. |
5349 ]. |
5358 sourceCodeManager notNil ifTrue:[ |
5358 sourceCodeManager notNil ifTrue:[ |
5359 classFilename ~= source ifTrue:[ |
5359 classFilename ~= source ifTrue:[ |
5360 package notNil ifTrue:[ |
5360 package notNil ifTrue:[ |
5361 sep := package indexOfAny:'/\:'. |
5361 sep := package indexOfAny:'/\:'. |
5362 sep ~~ 0 ifTrue:[ |
5362 sep ~~ 0 ifTrue:[ |
5363 |revisionInfo revision| |
|
5364 |
|
5365 mod := package copyTo:sep - 1. |
5363 mod := package copyTo:sep - 1. |
5366 dir := package copyFrom:sep + 1. |
5364 dir := package copyFrom:sep + 1. |
5367 revisionInfo := mod extensionsRevisionInfoForManager:sourceCodeManager. |
5365 sourceStream := sourceCodeManager streamForClass:nil fileName:source revision:(self binaryRevision) directory:dir module:mod cache:true. |
5368 revision := |
|
5369 (revisionInfo notNil and:[ source = revisionInfo fileName ]) ifTrue:[ |
|
5370 revisionInfo revision. |
|
5371 ] ifFalse:[ |
|
5372 self binaryRevision. |
|
5373 ]. |
|
5374 sourceStream := sourceCodeManager streamForClass:nil fileName:source revision:revision directory:dir module:mod cache:true. |
|
5375 ] |
5366 ] |
5376 ]. |
5367 ]. |
5377 ]. |
5368 ]. |
5378 sourceStream isNil ifTrue:[ |
5369 sourceStream isNil ifTrue:[ |
5379 classFilename isNil ifTrue:[ |
5370 classFilename isNil ifTrue:[ |
5462 |
5453 |
5463 "Created: / 10-11-1995 / 21:05:13 / cg" |
5454 "Created: / 10-11-1995 / 21:05:13 / cg" |
5464 "Modified: / 22-04-1998 / 19:20:50 / ca" |
5455 "Modified: / 22-04-1998 / 19:20:50 / ca" |
5465 "Modified: / 05-11-2001 / 16:36:30 / cg" |
5456 "Modified: / 05-11-2001 / 16:36:30 / cg" |
5466 "Modified: / 08-12-2011 / 19:16:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
5457 "Modified: / 08-12-2011 / 19:16:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
5467 "Modified (comment): / 01-03-2017 / 12:32:55 / mawalch" |
|
5468 ! |
5458 ! |
5469 |
5459 |
5470 updateVersionMethodFor:newRevisionString |
5460 updateVersionMethodFor:newRevisionString |
5471 "{ Pragma: +optSpace }" |
5461 "{ Pragma: +optSpace }" |
5472 |
5462 |