Updates from SVN
authorJan Vrany <jan.vrany@fit.cvut.cz>
Mon, 08 Aug 2011 15:36:38 +0200
changeset 756 e3b33ff46245
parent 755 e179ad6a1952
child 757 29a88a31c30c
Updates from SVN
SVN__Branch.st
--- a/SVN__Branch.st	Mon Aug 08 15:36:37 2011 +0200
+++ b/SVN__Branch.st	Mon Aug 08 15:36:38 2011 +0200
@@ -1,14 +1,69 @@
+"
+ Copyright (c) 2007-2010 Jan Vrany
+ Copyright (c) 2009-2010 eXept Software AG
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation
+ files (the 'Software'), to deal in the Software without
+ restriction, including without limitation the rights to use,
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following
+ conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ OTHER DEALINGS IN THE SOFTWARE.
+"
 "{ Package: 'stx:libsvn' }"
 
 "{ NameSpace: SVN }"
 
 Object subclass:#Branch
-	instanceVariableNames:'repository path'
+	instanceVariableNames:'repository path url'
 	classVariableNames:''
 	poolDictionaries:''
 	category:'SVN-Core'
 !
 
+!Branch class methodsFor:'documentation'!
+
+copyright
+"
+ Copyright (c) 2007-2010 Jan Vrany
+ Copyright (c) 2009-2010 eXept Software AG
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation
+ files (the 'Software'), to deal in the Software without
+ restriction, including without limitation the rights to use,
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following
+ conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ OTHER DEALINGS IN THE SOFTWARE.
+
+"
+! !
 
 !Branch class methodsFor:'instance creation'!
 
@@ -22,6 +77,12 @@
     "Created: / 19-08-2009 / 11:19:44 / Jan Vrany <vranyj1@fel.cvut.cz>"
 ! !
 
+!Branch class methodsFor:'others'!
+
+version_CVS
+    ^ '$ÂHeader: /cvs/stx/stx/libsvn/SVN__Branch.st,v 1.4 2009/10/19 12:21:59 fm Exp Â$'
+! !
+
 !Branch methodsFor:'accessing'!
 
 icon
@@ -37,9 +98,9 @@
 
 name
 
-    ^path isNilOrEmptyCollection 
-        ifTrue:['<no branch>']
-        ifFalse:[path]
+    ^self isTrunk 
+        ifTrue:[(path ? 'trunk/') allButLast asText allBold]
+        ifFalse:[path allButLast]
 
     "Created: / 19-03-2008 / 08:27:54 / janfrog"
     "Modified: / 31-03-2008 / 15:20:04 / janfrog"
@@ -81,71 +142,112 @@
 
 url
 
-    ^repository url , path
+    url ifNil:[url := repository urlForBranch: path].
+    ^url
 
     "Created: / 19-03-2008 / 09:40:41 / janfrog"
+    "Modified: / 14-03-2011 / 09:58:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !Branch methodsFor:'accessing - change sets'!
 
 changeSet
 
-    ^self changeSet: Revision head
+    ^self changeSet: SVN::Revision head
 
     "Created: / 19-04-2008 / 14:09:08 / Jan Vrany <vranyj1@fel.cvut.cz>"
 !
 
-changeSet: revision
+changeSet:revision 
+
+    ^self changeSet:revision ignoreAutoloaded: false
+!
 
-    | entries changeSet |
-    SVN::ActivityNotification notify:'Listing repository'.
-    entries := (self list: revision) select:[:entry|entry kind isSourceContainer].
+changeSet:revision ignoreAutoloaded:ignoreAutoloaded 
+    |entries changeSet|
+
+    ActivityNotification notify:'Listing repository'.
+    entries := (self list:revision) select:[:entry | entry isSourceEntry ].
     changeSet := ChangeSet new.
-    SVN::ActivityNotification notify:'Creating change set for revision ' , revision printString.
-    entries withIndexDo:
-        [:entry :index|
-        changeSet addAll:
-            (self changeSetForContainer: entry path revision: revision).
-        SVN::ProgressNotification 
-            notify:'Creating change set for revision ' , revision printString
-            progress: ((100 / entries size) * index) rounded].
-    ^changeSet
+    ActivityNotification notify:'Reading rev. ' , revision printString.
+    entries 
+        withIndexDo:[:entry :index | 
+            ProgressNotification 
+                notify:'Reading ' , entry path , ' rev. ' , revision printString
+                progress:((100 / entries size) * index) rounded.
+            changeSet addAll:(self 
+                        changeSetForContainer:entry path
+                        revision:revision
+                        ignoreAutoloaded:ignoreAutoloaded).
+        ].
+    ^ changeSet
 
     "Created: / 19-04-2008 / 14:09:30 / Jan Vrany <vranyj1@fel.cvut.cz>"
     "Modified: / 28-10-2008 / 13:00:05 / Jan Vrany <vranyj1@fel.cvut.cz>"
+    "Modified: / 19-11-2009 / 15:08:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 changeSetForClass: cls
 
-    ^self changeSetForClass: cls revision: Revision head
+    ^self changeSetForClass: cls revision: SVN::Revision head
 
     "Created: / 19-04-2008 / 17:24:04 / Jan Vrany <vranyj1@fel.cvut.cz>"
 !
 
 changeSetForClass: cls revision: revision
 
-    ^self 
-        changeSetForContainer:(repository containerNameForClass: cls)
-        revision: revision.
+    ^self changeSetForClass: cls revision: revision ignoreAutoloaded: false
+
+
 
     "Created: / 19-04-2008 / 17:23:46 / Jan Vrany <vranyj1@fel.cvut.cz>"
     "Modified: / 19-04-2008 / 20:20:17 / Jan Vrany <vranyj1@fel.cvut.cz>"
 !
 
+changeSetForClass: cls revision: revision ignoreAutoloaded: ignoreAutoloaded
+
+
+    ^(ignoreAutoloaded or:[cls isLoaded])
+        ifTrue:
+            [self 
+                changeSetForContainer:(repository containerNameForClass: cls)
+                revision: revision]
+        ifFalse:
+            [ChangeSet new].
+
+    "Created: / 19-04-2008 / 17:23:46 / Jan Vrany <vranyj1@fel.cvut.cz>"
+    "Modified: / 19-04-2008 / 20:20:17 / Jan Vrany <vranyj1@fel.cvut.cz>"
+    "Modified: / 19-11-2009 / 15:07:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 changeSetForContainer: container revision: revision
 
+    ^self changeSetForContainer: container revision: revision ignoreAutoloaded: false
+
+    "Created: / 19-04-2008 / 20:18:51 / Jan Vrany <vranyj1@fel.cvut.cz>"
+    "Modified: / 19-11-2009 / 15:09:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+changeSetForContainer: container revision: revision ignoreAutoloaded: ignoreAutoloaded
+
     | containerStream |
+    ignoreAutoloaded ifTrue:
+        [|cls|
+        cls := SVN::Repository classFromContainerName: container.
+        (cls isNil or: [cls isLoaded not]) ifTrue:[^ChangeSet new]].
+
     containerStream := (self 
                             cat:container
                             revision: revision) readStream.
-    ^ChangeSet fromStream: containerStream.
+    ^(ChangeSet fromStream: containerStream)
+        name: container , ' r' , revision printString
 
-    "Created: / 19-04-2008 / 20:18:51 / Jan Vrany <vranyj1@fel.cvut.cz>"
+    "Created: / 19-11-2009 / 15:08:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 changeSetForExtensions
 
-    ^self changeSetForExtensionsRevision: Revision head
+    ^self changeSetForExtensionsRevision: SVN::Revision head
 
     "Created: / 19-04-2008 / 20:21:29 / Jan Vrany <vranyj1@fel.cvut.cz>"
 !
@@ -165,27 +267,25 @@
 
     diffSet := self diffSetBetweenImageAndRevision:revision.
     classesToRemove := Set new.
-    SVN::ActivityNotification notify:'Computing load set'.
-    "self = image, arg = revision"
-    ^(diffSet onlyInArg) ,
-        (diffSet changed collect:[:changePair | changePair second ])
+    ActivityNotification notify:'Computing load set'.
+     "self = image, arg = revision"
+    ^ (diffSet onlyInArg) 
+        , (diffSet changed collect:[:changePair | changePair second ]) 
             , (diffSet onlyInReceiver 
-                select:[:change | change isClassDefinitionChange ]
-                thenCollect:
-                    [:change |
-                    classesToRemove add:change className.
-                    ClassRemoveChange className:change className])
-                , (diffSet onlyInReceiver 
-                        select:
-                            [:change | 
-                            change isMethodDefinitionChange 
-                                and:[ (classesToRemove includes:change className) not ]]
-                            thenCollect:
-                                [:change | 
-                                MethodRemoveChange className:change className selector:change selector])
-
-    "Created: / 22-10-2008 / 11:08:06 / Jan Vrany <vranyj1@fel.cvut.cz>"
-    "Modified: / 07-11-2008 / 08:09:48 / Jan Vrany <vranyj1@fel.cvut.cz>"
+                    select:[:change | change isClassDefinitionChange ]
+                    thenCollect:[:change | 
+                        classesToRemove add:change className.
+                        ClassRemoveChange className:change className
+                    ]) 
+            , (diffSet onlyInReceiver 
+                    select:[:change | 
+                        change isMethodDefinitionChange 
+                            and:[ (classesToRemove includes:change className) not ]
+                    ]
+                    thenCollect:[:change | 
+                        MethodRemoveChange className:change className selector:change selector
+                    ])
+                 "Created: / 22-10-2008 / 11:08:06 / Jan Vrany <vranyj1@fel.cvut.cz>" "Modified: / 07-11-2008 / 08:09:48 / Jan Vrany <vranyj1@fel.cvut.cz>"
 ! !
 
 !Branch methodsFor:'accessing - diff sets'!
@@ -193,11 +293,15 @@
 diffSetBetweenImageAndRevision: revision
 
     | imageChangeSet revisionChangeSet |
-    imageChangeSet := ChangeSet forPackage: self package.
-    revisionChangeSet := self changeSet: revision.
-    ^imageChangeSet diffSetsAgainst: revisionChangeSet
+    imageChangeSet := ChangeSet forPackage: self package ignoreAutoloaded: true.
+    revisionChangeSet := self changeSet: revision ignoreAutoloaded: true.
+    ^(ChangeSetDiff versionA: imageChangeSet versionB: revisionChangeSet)
+        versionALabel: 'Current (in image)';
+        versionBLabel: revision printString
 
     "Created: / 20-05-2008 / 17:56:02 / Jan Vrany <vranyj1@fel.cvut.cz>"
+    "Modified: / 25-03-2010 / 16:33:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 07-07-2011 / 20:02:19 / jv"
 !
 
 diffSetBetweenRevision: revisionA andRevision: revisionB
@@ -205,36 +309,57 @@
     | revisionAChangeSet revisionBChangeSet |
     revisionAChangeSet := self changeSet: revisionA.
     revisionBChangeSet := self changeSet: revisionB.
-    ^revisionAChangeSet diffSetsAgainst: revisionBChangeSet
+    ^(ChangeSetDiff versionA: revisionAChangeSet versionB: revisionBChangeSet)
+        versionALabel: revisionA printString;
+        versionBLabel: revisionB printString
 
     "Created: / 20-05-2008 / 17:58:20 / Jan Vrany <vranyj1@fel.cvut.cz>"
+    "Modified: / 10-11-2009 / 11:22:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 07-07-2011 / 20:02:27 / jv"
 !
 
 diffSetForClass: cls betweenImageAndRevision: revision
 
     | imageChangeSet revisionChangeSet |
+
+    ActivityNotification notify: 'Reading class ',cls fullName asText allBold.
     imageChangeSet := ChangeSet forExistingClass:cls withExtensions: false extensionsOnly:false.
+    ActivityNotification notify: 'Reading class ',cls fullName asText allBold, ' (rev. ', revision printString,')'.
     revisionChangeSet := self changeSetForClass: cls revision: revision.
-    ^imageChangeSet diffSetsAgainst: revisionChangeSet
+    ActivityNotification notify: 'Computing differences for ',cls fullName asText allBold.
+    ^(ChangeSetDiff versionA: imageChangeSet versionB: revisionChangeSet)
+        name: cls fullName;
+        versionALabel: 'Current (in image)';
+        versionBLabel: revision printString
 
     "Created: / 19-04-2008 / 18:34:06 / Jan Vrany <vranyj1@fel.cvut.cz>"
+    "Modified: / 25-03-2010 / 16:33:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 07-07-2011 / 20:02:30 / jv"
 !
 
 diffSetForExtensionsBetweenImageAndRevision: revision
 
     | imageChangeSet revisionChangeSet |
+    ActivityNotification notify: 'Reading extensions for ',self package asText allItalic.
     imageChangeSet := ChangeSet forExistingMethods: repository packageExtensions.
+    ActivityNotification notify: 'Reading extensions for ',self package asText allItalic, ' (rev. ', revision printString,')'.
     revisionChangeSet := self changeSetForExtensionsRevision: revision.
-    ^imageChangeSet diffSetsAgainst: revisionChangeSet
+    ActivityNotification notify: 'Computing differences'.
+    ^(ChangeSetDiff versionA: imageChangeSet versionB: revisionChangeSet)
+        name: 'package extensions';
+        versionALabel: 'Current (in image)';
+        versionBLabel: revision printString
 
     "Created: / 19-04-2008 / 19:08:33 / Jan Vrany <vranyj1@fel.cvut.cz>"
+    "Modified: / 25-03-2010 / 16:33:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 07-07-2011 / 20:02:34 / jv"
 ! !
 
 !Branch methodsFor:'commands'!
 
 cat: file
 
-    ^self cat: file revision: Revision head
+    ^self cat: file revision: SVN::Revision head
 
     "Created: / 19-04-2008 / 10:51:54 / Jan Vrany <vranyj1@fel.cvut.cz>"
 !
@@ -254,7 +379,7 @@
 list
 
 
-    ^self list: Revision head.
+    ^self list: SVN::Revision head.
 
     "Created: / 19-04-2008 / 13:42:23 / Jan Vrany <vranyj1@fel.cvut.cz>"
 !
@@ -334,13 +459,20 @@
     "Created: / 31-03-2008 / 14:37:45 / janfrog"
 ! !
 
+!Branch methodsFor:'converting'!
+
+asString
+
+    ^path
+
+    "Created: / 09-03-2010 / 22:50:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !Branch methodsFor:'displaying'!
 
-displayOn:aGC x:x y:y
+displayString
 
-    ^(LabelAndIcon 
-        label: self name
-        icon: self icon) displayOn: aGC x:x y:y
+    ^LabelAndIcon label: self name icon: self icon
 
     "Created: / 14-04-2008 / 11:11:01 / Jan Vrany <vranyj1@fel.cvut.cz>"
 ! !
@@ -384,14 +516,6 @@
 
 !Branch class methodsFor:'documentation'!
 
-version
-    ^ '$Header$'
-!
-
-version_CVS
-    ^ '$Header$'
-!
-
 version_SVN
-    ^'§Id: SVN__Branch.st 110 2009-08-19 13:21:10Z vranyj1 §'
+    ^ '§Id: SVN__Branch.st 353 2011-07-07 20:51:28Z vranyj1 §'
 ! !