74
|
1 |
"{ Package: 'stx:goodies/monticello' }"
|
|
2 |
|
|
3 |
Object subclass:#MCFrontier
|
|
4 |
instanceVariableNames:'frontier bag'
|
|
5 |
classVariableNames:''
|
|
6 |
poolDictionaries:''
|
629
|
7 |
category:'SCM-Monticello-Versioning'
|
74
|
8 |
!
|
|
9 |
|
|
10 |
|
|
11 |
!MCFrontier class methodsFor:'instance creation'!
|
|
12 |
|
|
13 |
frontierOn: aVersionInfo
|
|
14 |
^ self frontierOnAll: (Array with: aVersionInfo)
|
|
15 |
!
|
|
16 |
|
|
17 |
frontierOn: aVersionInfo and: otherVersionInfo
|
|
18 |
^ self frontierOnAll: (Array with: aVersionInfo with: otherVersionInfo)
|
|
19 |
!
|
|
20 |
|
|
21 |
frontierOnAll: aCollection
|
|
22 |
| remaining allVersions |
|
|
23 |
remaining := Bag new.
|
|
24 |
allVersions _ (aCollection gather: [:ea | ea withBreadthFirstAncestors]) asSet.
|
|
25 |
allVersions do: [:ea | remaining addAll: ea ancestors].
|
|
26 |
^self new frontier: aCollection bag: remaining
|
|
27 |
! !
|
|
28 |
|
|
29 |
!MCFrontier methodsFor:'accessing'!
|
|
30 |
|
|
31 |
frontier
|
|
32 |
^frontier
|
|
33 |
! !
|
|
34 |
|
|
35 |
!MCFrontier methodsFor:'advancing'!
|
|
36 |
|
|
37 |
remove: aVersionInfo
|
|
38 |
frontier remove: aVersionInfo.
|
|
39 |
aVersionInfo ancestors do:
|
|
40 |
[ :ancestor |
|
|
41 |
bag remove: ancestor.
|
|
42 |
(bag occurrencesOf: ancestor) = 0
|
|
43 |
ifTrue: [frontier add: ancestor]].
|
|
44 |
^aVersionInfo
|
|
45 |
!
|
|
46 |
|
|
47 |
removeAll: collection
|
|
48 |
collection do: [ :n | self remove: n]
|
|
49 |
! !
|
|
50 |
|
|
51 |
!MCFrontier methodsFor:'initialization'!
|
|
52 |
|
|
53 |
frontier: f bag: remaining
|
|
54 |
frontier := f asOrderedCollection.
|
|
55 |
bag := remaining
|
|
56 |
! !
|
|
57 |
|
|
58 |
!MCFrontier class methodsFor:'documentation'!
|
|
59 |
|
|
60 |
version
|
629
|
61 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCFrontier.st,v 1.2 2012-09-11 21:22:09 cg Exp $'
|
74
|
62 |
! !
|