75
|
1 |
"{ Package: 'stx:goodies/monticello' }"
|
|
2 |
|
|
3 |
Object subclass:#MCMergeRecord
|
|
4 |
instanceVariableNames:'version packageSnapshot ancestorInfo ancestor ancestorSnapshot
|
|
5 |
imagePatch mergePatch'
|
|
6 |
classVariableNames:''
|
|
7 |
poolDictionaries:''
|
640
|
8 |
category:'SCM-Monticello-Versioning'
|
75
|
9 |
!
|
|
10 |
|
|
11 |
|
|
12 |
!MCMergeRecord class methodsFor:'as yet unclassified'!
|
|
13 |
|
|
14 |
version: aVersion
|
|
15 |
^ self basicNew initializeWithVersion: aVersion
|
|
16 |
! !
|
|
17 |
|
|
18 |
!MCMergeRecord methodsFor:'as yet unclassified'!
|
|
19 |
|
|
20 |
ancestorInfo
|
|
21 |
^ ancestorInfo ifNil: [ancestorInfo _ version info commonAncestorWith: version workingCopy ancestry]
|
|
22 |
!
|
|
23 |
|
|
24 |
ancestorSnapshot
|
|
25 |
^ ancestorSnapshot ifNil: [ancestorSnapshot _ version workingCopy findSnapshotWithVersionInfo: self ancestorInfo]
|
|
26 |
!
|
|
27 |
|
|
28 |
imageIsClean
|
|
29 |
| ancestors |
|
|
30 |
ancestors _ version workingCopy ancestors.
|
|
31 |
^ ancestors size = 1
|
|
32 |
and: [ancestors first = self ancestorInfo]
|
|
33 |
and: [self imagePatch isEmpty]
|
|
34 |
!
|
|
35 |
|
|
36 |
imagePatch
|
|
37 |
^ imagePatch ifNil: [imagePatch _ self packageSnapshot patchRelativeToBase: self ancestorSnapshot]
|
|
38 |
!
|
|
39 |
|
|
40 |
initializeWithVersion: aVersion
|
|
41 |
version _ aVersion
|
|
42 |
!
|
|
43 |
|
|
44 |
isAncestorMerge
|
|
45 |
^ version workingCopy ancestry hasAncestor: version info
|
|
46 |
!
|
|
47 |
|
|
48 |
mergePatch
|
|
49 |
^ mergePatch ifNil: [mergePatch _ version snapshot patchRelativeToBase: self ancestorSnapshot]
|
|
50 |
!
|
|
51 |
|
|
52 |
packageSnapshot
|
|
53 |
^ packageSnapshot ifNil: [packageSnapshot _ version package snapshot]
|
|
54 |
!
|
|
55 |
|
|
56 |
updateWorkingCopy
|
|
57 |
self isAncestorMerge ifFalse:
|
|
58 |
[self imageIsClean
|
|
59 |
ifTrue: [version workingCopy loaded: version]
|
|
60 |
ifFalse: [version workingCopy merged: version]]
|
|
61 |
!
|
|
62 |
|
|
63 |
version
|
|
64 |
^ version
|
|
65 |
! !
|
|
66 |
|
|
67 |
!MCMergeRecord class methodsFor:'documentation'!
|
|
68 |
|
|
69 |
version
|
640
|
70 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCMergeRecord.st,v 1.2 2012-09-11 21:23:10 cg Exp $'
|
75
|
71 |
! !
|