merged in jv's changes
authorClaus Gittinger <cg@exept.de>
Wed, 05 Feb 2014 18:52:25 +0100
changeset 3462 b4af88a682ec
parent 3461 1e80c5caaed6
child 3463 94e2c950bba2
merged in jv's changes
ChangeSetDiffSet.st
--- a/ChangeSetDiffSet.st	Wed Feb 05 18:52:23 2014 +0100
+++ b/ChangeSetDiffSet.st	Wed Feb 05 18:52:25 2014 +0100
@@ -74,11 +74,22 @@
 !ChangeSetDiffSet class methodsFor:'others'!
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic3/ChangeSetDiffSet.st,v 1.6 2013-09-05 23:14:20 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic3/ChangeSetDiffSet.st,v 1.7 2014-02-05 17:52:25 cg Exp $'
 ! !
 
 !ChangeSetDiffSet methodsFor:'accessing'!
 
+depth
+    | depth |
+    depth := 0.
+    diffs do:[:diff|
+        depth := depth max: diff depth
+    ].
+    ^depth + 1
+
+    "Created: / 15-01-2013 / 11:27:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 diffs
     ^ diffs
 !
@@ -114,6 +125,44 @@
     name := aString.
 !
 
+nextEntryAfter: entry suchThat: predicate
+    | found |
+
+    entry isNil ifTrue:[ 
+        self do:[:each|(predicate value: each) ifTrue:[^each]].
+        ^nil
+    ].
+
+    found := false.
+    self do:[:each|
+        each == entry ifTrue:[
+            found := true
+        ] ifFalse:[
+            (found and:[predicate value: each]) ifTrue:[ ^ each ]
+        ].
+    ].
+    ^nil
+
+    "Created: / 17-01-2013 / 13:00:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 17-01-2013 / 16:55:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+nextEntryBefore: entry suchThat: predicate
+    | last |
+
+    entry isNil ifTrue:[ 
+        ^nil
+    ].
+
+    self do:[:each|
+        each == entry ifTrue:[ ^ last ].
+        (predicate value: each) ifTrue:[last := each].
+    ].
+    ^nil
+
+    "Created: / 17-01-2013 / 16:57:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 resolution
     | changeset |
 
@@ -228,10 +277,27 @@
     diffs do:[:diff|diff flattenOn: stream]
 
     "Created: / 05-12-2009 / 11:07:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+sort:sortBlock
+    "superclass ChangeSetDiffComponent says that I am responsible to implement this method"
+
+    diffs sort: sortBlock.
+    diffs do:[:e|e sort: sortBlock].
+
+    "Modified: / 17-01-2013 / 14:18:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !ChangeSetDiffSet methodsFor:'testing'!
 
+isConflict
+    "Return true, if there is a conflict."
+
+    ^ self diffs anySatisfy:[:e|e isConflict].
+
+    "Created: / 01-08-2012 / 17:10:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 isDiffSet
     ^ true
 !
@@ -244,6 +310,14 @@
     "Modified: / 09-12-2009 / 17:43:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
+isForCopyrightMethod
+    "Returns true, if this is an entry for #copyright method"
+
+    ^diffs allSatisfy:[:each|each isForCopyrightMethod]
+
+    "Created: / 01-08-2012 / 16:38:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 isForVersionMethod
     "Returns true, if this is an entry for version method"
 
@@ -263,10 +337,10 @@
 !ChangeSetDiffSet class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic3/ChangeSetDiffSet.st,v 1.6 2013-09-05 23:14:20 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic3/ChangeSetDiffSet.st,v 1.7 2014-02-05 17:52:25 cg Exp $'
 !
 
 version_SVN
-    ^ '$Id: ChangeSetDiffSet.st,v 1.6 2013-09-05 23:14:20 cg Exp $'
+    ^ '$Id: ChangeSetDiffSet.st,v 1.7 2014-02-05 17:52:25 cg Exp $'
 ! !