80
|
1 |
"{ Package: 'stx:goodies/monticello' }"
|
|
2 |
|
|
3 |
Object subclass:#MCVersionDependency
|
|
4 |
instanceVariableNames:'package versionInfo'
|
|
5 |
classVariableNames:''
|
|
6 |
poolDictionaries:''
|
697
|
7 |
category:'SCM-Monticello-Versioning'
|
80
|
8 |
!
|
|
9 |
|
|
10 |
|
|
11 |
!MCVersionDependency class methodsFor:'as yet unclassified'!
|
|
12 |
|
|
13 |
package: aPackage info: aVersionInfo
|
|
14 |
^ self basicNew initializeWithPackage: aPackage info: aVersionInfo
|
|
15 |
! !
|
|
16 |
|
|
17 |
!MCVersionDependency methodsFor:'accessing'!
|
|
18 |
|
|
19 |
package
|
|
20 |
^ package
|
|
21 |
!
|
|
22 |
|
|
23 |
repositoryGroup
|
|
24 |
^ self package workingCopy repositoryGroup
|
|
25 |
!
|
|
26 |
|
|
27 |
versionInfo
|
|
28 |
^ versionInfo
|
|
29 |
! !
|
|
30 |
|
|
31 |
!MCVersionDependency methodsFor:'comparing'!
|
|
32 |
|
|
33 |
= other
|
|
34 |
^ other species = self species
|
|
35 |
and: [other versionInfo = versionInfo
|
|
36 |
and: [other package = package]]
|
|
37 |
!
|
|
38 |
|
|
39 |
hash
|
|
40 |
^ versionInfo hash
|
|
41 |
! !
|
|
42 |
|
|
43 |
!MCVersionDependency methodsFor:'initialize-release'!
|
|
44 |
|
|
45 |
initializeWithPackage: aPackage info: aVersionInfo
|
|
46 |
package _ aPackage.
|
|
47 |
versionInfo _ aVersionInfo
|
|
48 |
! !
|
|
49 |
|
|
50 |
!MCVersionDependency methodsFor:'resolving'!
|
|
51 |
|
|
52 |
resolve
|
|
53 |
^ self repositoryGroup
|
|
54 |
versionWithInfo: versionInfo
|
|
55 |
ifNone: [ MCRepositoryGroup default versionWithInfo: versionInfo ifNone: []]
|
|
56 |
! !
|
|
57 |
|
|
58 |
!MCVersionDependency methodsFor:'testing'!
|
|
59 |
|
|
60 |
isCurrent
|
|
61 |
^ package hasWorkingCopy
|
|
62 |
and: [self isFulfilled
|
|
63 |
and: [package workingCopy modified not]]
|
|
64 |
!
|
|
65 |
|
|
66 |
isFulfilled
|
|
67 |
^package hasWorkingCopy
|
|
68 |
and: [self isFulfilledBy: package workingCopy ancestry]
|
|
69 |
!
|
|
70 |
|
|
71 |
isFulfilledBy: anAncestry
|
|
72 |
^ anAncestry ancestors includes: versionInfo
|
|
73 |
!
|
|
74 |
|
|
75 |
isFulfilledByAncestors
|
|
76 |
^ package hasWorkingCopy
|
|
77 |
and: [self isFulfilledByAncestorsOf: package workingCopy ancestry]
|
|
78 |
!
|
|
79 |
|
|
80 |
isFulfilledByAncestorsOf: anAncestry
|
|
81 |
^ anAncestry hasAncestor: versionInfo
|
|
82 |
!
|
|
83 |
|
|
84 |
isOlder
|
|
85 |
"Answer true if I represent an older version of a package that is loaded."
|
|
86 |
^ package hasWorkingCopy
|
|
87 |
and: [self isFulfilled not
|
|
88 |
and: [ self isFulfilledByAncestors
|
|
89 |
and: [package workingCopy modified not]]]
|
|
90 |
! !
|
|
91 |
|
|
92 |
!MCVersionDependency class methodsFor:'documentation'!
|
|
93 |
|
|
94 |
version
|
697
|
95 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCVersionDependency.st,v 1.2 2012-09-11 21:30:13 cg Exp $'
|
80
|
96 |
! !
|