SourceCodeManagerUtilities.st
changeset 1057 6903d4d5097d
parent 1056 c9cc2b5d065e
child 1058 90807c795eb5
equal deleted inserted replaced
1056:c9cc2b5d065e 1057:6903d4d5097d
  1040     answer isNil ifTrue:[^ self].
  1040     answer isNil ifTrue:[^ self].
  1041 
  1041 
  1042     self activityNotification:'updating...'.
  1042     self activityNotification:'updating...'.
  1043     changedClasses := IdentitySet new.
  1043     changedClasses := IdentitySet new.
  1044 
  1044 
  1045     answer == #load ifTrue:[
  1045     Class withoutUpdatingChangesDo:[
  1046         changedClassDefinitions do:[:eachChangeArr | "apply this change (go to rep-version)"
  1046         answer == #load ifTrue:[
  1047                                      |cHere cRep| 
  1047             changedClassDefinitions do:[:eachChangeArr | "apply this change (go to rep-version)"
  1048                                      cHere := eachChangeArr at:1.
  1048                                          |cHere cRep| 
  1049                                      cRep := eachChangeArr at:2.
  1049                                          cHere := eachChangeArr at:1.
  1050                                      cRep apply.
  1050                                          cRep := eachChangeArr at:2.
  1051                                      cRep isMethodChange ifTrue:[
  1051                                          cRep apply.
  1052                                          cRep changeMethod setPackage:(cRep changeClass package).
  1052                                          cRep isMethodChange ifTrue:[
  1053                                          changedClasses add:cRep changeClass.
  1053                                              cRep changeMethod setPackage:(cRep changeClass package).
  1054                                      ]
  1054                                              changedClasses add:cRep changeClass.
  1055                    ].
  1055                                          ]
       
  1056                        ].
       
  1057         ].
  1056         onlyInRep do:[:eachChange | "apply this change (method only present in rep-version)"
  1058         onlyInRep do:[:eachChange | "apply this change (method only present in rep-version)"
  1057                                      eachChange apply.
  1059                                      eachChange apply.
  1058                                      eachChange isMethodChange ifTrue:[
  1060                                      eachChange isMethodChange ifTrue:[
  1059                                          eachChange changeMethod setPackage:(eachChange changeClass package).
  1061                                          eachChange changeMethod setPackage:(eachChange changeClass package).
  1060                                          changedClasses add:eachChange changeClass.   
  1062                                          changedClasses add:eachChange changeClass.   
  1061                                      ]
  1063                                      ]
  1062                      ].
  1064                      ].
  1063         onlyHere do:[:eachChange |   "remove this change (method not present in rep-version)"
  1065         answer == #load ifTrue:[
  1064                                      |cClass cSel|
  1066             onlyHere do:[:eachChange |   "remove this change (method not present in rep-version)"
  1065                                      eachChange isMethodChange ifTrue:[
  1067                                          |cClass cSel|
  1066                                          cClass := eachChange changeClass.
  1068                                          eachChange isMethodChange ifTrue:[
  1067                                          cSel := eachChange selector.
  1069                                              cClass := eachChange changeClass.
  1068                                          cClass removeSelector:cSel.
  1070                                              cSel := eachChange selector.
  1069                                      ]
  1071                                              cClass removeSelector:cSel.
  1070                     ].
  1072                                          ]
  1071         changed do:[:eachChangeArr | "apply this change (go to rep-version)"
  1073                         ].
  1072                                      |cHere cRep| 
  1074             changed do:[:eachChangeArr | "apply this change (go to rep-version)"
  1073                                      cHere := eachChangeArr at:1.
  1075                                          |cHere cRep| 
  1074                                      cRep := eachChangeArr at:2.
  1076                                          cHere := eachChangeArr at:1.
  1075                                      cRep apply.
  1077                                          cRep := eachChangeArr at:2.
  1076                                      cRep isMethodChange ifTrue:[
  1078                                          cRep apply.
  1077                                          cRep changeMethod setPackage:(cRep changeClass package).
  1079                                          cRep isMethodChange ifTrue:[
  1078                                          changedClasses add:cRep changeClass.
  1080                                              cRep changeMethod setPackage:(cRep changeClass package).
  1079                                      ]
  1081                                              changedClasses add:cRep changeClass.
  1080                    ].
  1082                                          ]
  1081         "/ make all methods belong to the classes project
  1083                        ].
  1082         self setPackageOfAllMethodsIn:aClass to:aClass package.
  1084             "/ make all methods belong to the classes project
  1083         versionMethodsRep size == 1 ifTrue:[
       
  1084             versionMethodsRep first apply.
       
  1085             self setPackageOfAllMethodsIn:aClass to:aClass package.
  1085             self setPackageOfAllMethodsIn:aClass to:aClass package.
  1086         ] ifFalse:[
  1086             versionMethodsRep size == 1 ifTrue:[
  1087             self halt
  1087                 versionMethodsRep first apply.
  1088         ].
  1088                 self setPackageOfAllMethodsIn:aClass to:aClass package.
  1089     ] ifFalse:[
  1089             ] ifFalse:[
  1090         onlyInRep do:[:eachChange | "apply this change (method only present in rep-version)"
  1090                 self halt
  1091                                      eachChange apply.
  1091             ].
  1092                                      eachChange isMethodChange ifTrue:[
  1092         ].
  1093                                          eachChange changeMethod setPackage:(eachChange changeClass package).
       
  1094                                          changedClasses add:eachChange changeClass.   
       
  1095                                      ]
       
  1096                      ].
       
  1097     ].
  1093     ].
  1098     changedClasses do:[:eachClass |
  1094     changedClasses do:[:eachClass |
  1099          eachClass changed:#projectOrganization.
  1095          eachClass changed:#projectOrganization.
  1100     ].
  1096     ].
  1101     Smalltalk changed:#projectOrganization.
  1097     Smalltalk changed:#projectOrganization.
  1867 ! !
  1863 ! !
  1868 
  1864 
  1869 !SourceCodeManagerUtilities class methodsFor:'documentation'!
  1865 !SourceCodeManagerUtilities class methodsFor:'documentation'!
  1870 
  1866 
  1871 version
  1867 version
  1872     ^ '$Header: /cvs/stx/stx/libbasic3/SourceCodeManagerUtilities.st,v 1.59 2001-08-02 09:52:27 cg Exp $'
  1868     ^ '$Header: /cvs/stx/stx/libbasic3/SourceCodeManagerUtilities.st,v 1.60 2001-08-15 15:36:37 cg Exp $'
  1873 ! !
  1869 ! !