common/SCMAbstractPackageModel.st
changeset 382 b661dd389038
parent 380 c8b3776ece29
child 384 d946e0f0f12a
--- a/common/SCMAbstractPackageModel.st	Sun Feb 23 20:03:07 2014 +0000
+++ b/common/SCMAbstractPackageModel.st	Tue Feb 25 23:35:59 2014 +0000
@@ -91,6 +91,15 @@
     ^ self basicNew initialize.
 ! !
 
+!SCMAbstractPackageModel class methodsFor:'testing'!
+
+isAbstract
+    ^ self == SCMAbstractPackageModel
+
+    "Created: / 13-11-2012 / 23:07:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 25-02-2014 / 22:38:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !SCMAbstractPackageModel methodsFor:'accessing'!
 
 classes
@@ -200,6 +209,15 @@
     "Created: / 01-12-2012 / 02:03:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
+revision
+    "Return a logical revision of the package, i.e., a revision
+     on which the next commit will be based on"              
+
+    ^ self subclassResponsibility
+
+    "Modified (comment): / 25-02-2014 / 22:41:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 temporaryWorkingCopy
     self ensureTemporaryWorkingCopy.
     ^wc
@@ -838,6 +856,25 @@
     "Modified (format): / 19-03-2013 / 10:12:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!SCMAbstractPackageModel methodsFor:'testing'!
+
+isChildOf: anotherPackageModel
+    ^ anotherPackageModel isParentOf: self.
+
+    "Created: / 25-02-2014 / 22:51:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+isParentOf: anotherPackageModel    
+    | anotherName |
+
+    anotherName := anotherPackageModel name.
+    ^ (anotherName size) > (name size + 1)
+        and:[ (anotherName startsWith: name)
+            and:[ ':/' includes: (anotherName at: name size + 1) ]].
+
+    "Created: / 25-02-2014 / 22:50:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !SCMAbstractPackageModel methodsFor:'utils'!
 
 ensureTemporaryWorkingCopy