Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Monticello: Remove dead code #15351

Merged
merged 17 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ mcPackages := #(
'ConfigurationCommandLineHandler-Core'
'PragmaCollector'
'System-FileRegistry'
'MonticelloConfigurations'
'Gofer-Core'
'MonticelloFileTree-Core'
'MonticelloFileTree-FileSystem-Utilities'
Expand Down
3 changes: 1 addition & 2 deletions src/BaselineOfMetacello/BaselineOfMetacello.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ BaselineOfMetacello >> baseline: spec [
package: 'ConfigurationCommandLineHandler-Core';
package: 'PragmaCollector';
package: 'System-FileRegistry';
package: 'MonticelloConfigurations';
package: 'Gofer-Core';
package: 'Metacello-Base';
package: 'Metacello-Bitbucket';
Expand All @@ -38,7 +37,7 @@ BaselineOfMetacello >> baseline: spec [
package: 'Metacello-Gitlab-Tests'.

spec
group: 'Core' with: #('ScriptingExtensions' 'System-FileRegistry' 'FileSystem-Memory' 'Regex-Core' 'StartupPreferences' 'ConfigurationCommandLineHandler-Core' 'PragmaCollector' 'System-FileRegistry' 'MonticelloConfigurations' 'Gofer-Core' 'Metacello-Base' 'Metacello-Core' 'MonticelloFileTree-Core' 'MonticelloFileTree-FileSystem-Utilities' 'STON-Core' 'Metacello-GitBasedRepository' 'Metacello-GitHub' 'Metacello-Gitlab' 'Metacello-Bitbucket' 'MetacelloCommandLineHandler-Core');
group: 'Core' with: #('ScriptingExtensions' 'System-FileRegistry' 'FileSystem-Memory' 'Regex-Core' 'StartupPreferences' 'ConfigurationCommandLineHandler-Core' 'PragmaCollector' 'System-FileRegistry' 'Gofer-Core' 'Metacello-Base' 'Metacello-Core' 'MonticelloFileTree-Core' 'MonticelloFileTree-FileSystem-Utilities' 'STON-Core' 'Metacello-GitBasedRepository' 'Metacello-GitHub' 'Metacello-Gitlab' 'Metacello-Bitbucket' 'MetacelloCommandLineHandler-Core');
group: 'Tests' with: #( 'Metacello-TestsCore' 'Metacello-TestsMCCore' 'Metacello-TestsReference' 'Metacello-Gitlab-Tests');
group: 'default' with: #('Core') ]
]
19 changes: 5 additions & 14 deletions src/Gofer-Core/Gofer.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -177,20 +177,11 @@ Gofer >> configurationOf: aProjectName [
Gofer >> directory: aDirectoryOrString [
"Add a file-system repository at aDirectoryOrString."

| repository |
repository := (aDirectoryOrString isString and: [ aDirectoryOrString endsWith: '*' ])
ifTrue: [
MCSubDirectoryRepository new
directory: aDirectoryOrString allButLast asFileReference;
yourself ]
ifFalse: [
(MCDirectoryRepository new)
directory:
(aDirectoryOrString isString
ifTrue: [ aDirectoryOrString asFileReference ]
ifFalse: [ aDirectoryOrString ]);
yourself ].
self repository: repository
self repository: (MCDirectoryRepository new
directory: (aDirectoryOrString isString
ifTrue: [ aDirectoryOrString asFileReference ]
ifFalse: [ aDirectoryOrString ]);
yourself)
]

{ #category : 'repositories - options' }
Expand Down
12 changes: 0 additions & 12 deletions src/Gofer-Tests/GoferApiTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -196,18 +196,6 @@ GoferApiTest >> testSmalltalkhub [
self assert: gofer repositories: #('http://smalltalkhub.com/mc/dh83/ci/main/')
]

{ #category : 'tests - repositories' }
GoferApiTest >> testSubDirectoryRepository [

testingEnvironment
at: #MCSubDirectoryRepository
ifPresent: [ :subDirectoryRepositoryClass | |path|
path := (FileSystem disk workingDirectory / '*') fullName.
gofer directory: path.
self assert: gofer repositories: (Array with: path).
self assert: (gofer repositories first isKindOf: subDirectoryRepositoryClass) ]
]

{ #category : 'tests - references' }
GoferApiTest >> testVersionReference [

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -492,11 +492,6 @@ MCGitBasedNetworkRepository >> normalizeTagsData: jsonObject [
^ self subclassResponsibility
]

{ #category : 'accessing' }
MCGitBasedNetworkRepository >> possiblyNewerVersionsOfAnyOf: someVersions [
^ self localRepository possiblyNewerVersionsOfAnyOf: someVersions
]

{ #category : 'accessing' }
MCGitBasedNetworkRepository >> projectPath [
^ projectPath
Expand Down
39 changes: 0 additions & 39 deletions src/Monticello-GUI-Diff/MCVersionHistoryBrowser.extension.st

This file was deleted.

18 changes: 0 additions & 18 deletions src/Monticello-GUI-Diff/MCVersionInspector.extension.st

This file was deleted.

17 changes: 0 additions & 17 deletions src/Monticello-Tests/MCAncestryTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,6 @@ MCAncestryTest >> assertNamesOf: versionInfoCollection are: nameArray [
self assert: names asArray equals: nameArray
]

{ #category : 'asserting' }
MCAncestryTest >> assertPathTo: aSymbol is: anArray [
self
assertNamesOf: (self tree allAncestorsOnPathTo: (self treeFrom: {aSymbol}))
are: anArray
]

{ #category : 'tests' }
MCAncestryTest >> testCommonAncestors [
self assertCommonAncestorOf: #a2 and: #e2 is: #a1 in: self tree.
Expand Down Expand Up @@ -71,16 +64,6 @@ MCAncestryTest >> testDescendants [
self assert: (c2 commonAncestorWith: q2) equals: q1
]

{ #category : 'tests' }
MCAncestryTest >> testLinearPath [
self assertPathTo: #b1 is: #(b3 b2)
]

{ #category : 'tests' }
MCAncestryTest >> testPathToMissingAncestor [
self assertEmpty: (self tree allAncestorsOnPathTo: MCVersionInfo new)
]

{ #category : 'building' }
MCAncestryTest >> tree [
^ self treeFrom:
Expand Down
44 changes: 8 additions & 36 deletions src/Monticello-Tests/MCSerializationTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,6 @@ MCSerializationTest >> assertExtensionProvidedBy: aClass [
aClass readerClass extension
]

{ #category : 'asserting' }
MCSerializationTest >> assertSnapshotsMatchWith: writerClass [
| readerClass expected stream actual |
readerClass := writerClass readerClass.
expected := self mockSnapshot.
stream := ReadWriteStream on: ''.
(writerClass on: stream) writeSnapshot: expected.
actual := readerClass snapshotFromStream: stream reset.
self assertSnapshot: actual matches: expected.
]

{ #category : 'asserting' }
MCSerializationTest >> assertVersionInfosMatchWith: writerClass [
| stream readerClass expected actual |
Expand All @@ -55,30 +44,6 @@ MCSerializationTest >> assertVersionsMatchWith: writerClass [
self assertVersion: actual matches: expected.
]

{ #category : 'mocks' }
MCSerializationTest >> mockDiffyVersion [
| repos workingCopy base next |
repos := MCDictionaryRepository new.
workingCopy := MCWorkingCopy ensureForPackage: self mockPackage.
workingCopy repositoryGroup addRepository: repos.
MCRepositoryGroup default removeRepository: repos.
base := self mockVersion.
repos storeVersion: base.
self change: #a toReturn: 'a2'.
next := self mockVersionWithAncestor: base.
^ next asDiffAgainst: base
]

{ #category : 'testing' }
MCSerializationTest >> testMcdSerialization [
| stream expected actual |
expected := self mockDiffyVersion.
stream := ReadWriteStream on: ByteArray new.
MCMcdWriter fileOut: expected on: stream.
actual := MCMcdReader versionFromStream: stream reset.
self assertVersion: actual matches: expected.
]

{ #category : 'testing' }
MCSerializationTest >> testMczSerialization [
self assertVersionsMatchWith: MCMczWriter.
Expand All @@ -89,5 +54,12 @@ MCSerializationTest >> testMczSerialization [

{ #category : 'testing' }
MCSerializationTest >> testStSerialization [
self assertSnapshotsMatchWith: MCStWriter.

| readerClass expected stream actual |
readerClass := MCStWriter readerClass.
expected := self mockSnapshot.
stream := ReadWriteStream on: ''.
(MCStWriter on: stream) writeSnapshot: expected.
actual := (readerClass on: stream reset) snapshot.
self assertSnapshot: actual matches: expected
]
11 changes: 0 additions & 11 deletions src/Monticello-Tests/MCSubDirectoryRepositoryTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,3 @@ Class {
#package : 'Monticello-Tests',
#tag : 'Base'
}

{ #category : 'tests' }
MCSubDirectoryRepositoryTest >> testIssue7368 [
"This is not a usage example. Hopefully the ugly private method under test will be refactored out of existence soon ;)"

| collection |
collection := MCSubDirectoryRepository new splitNameVersionExtensionFor: 'Spec-Core-AuthorName.120.mcz'.
self assert: collection first equals: 'Spec-Core-AuthorName'.
self assert: collection second equals: 120.
self assert: collection third equals: 'mcz'.
]
77 changes: 0 additions & 77 deletions src/Monticello-Tests/MCWorkingCopyTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -127,42 +127,6 @@ MCWorkingCopyTest >> testAncestorMerge [

]

{ #category : 'tests' }
MCWorkingCopyTest >> testBackport [
| inst base final backported ancestry |
inst := self mockInstanceA.
base := self snapshot.

self assert: inst one equals: 1.

self change: #one toReturn: 2.
self change: #two toReturn: 3.

final := self snapshot.
[ workingCopy backportChangesTo: base info ]
on: MCChangeSelectionRequest
do: [ :e | e resume: e patch ].

self assert: inst one equals: 2.
self assert: inst two equals: 3.
ancestry := workingCopy ancestry.
self assert: ancestry ancestors size equals: 1.
self assert: ancestry ancestors first equals: base info.
self assert: ancestry stepChildren size equals: 1.
self assert: ancestry stepChildren first equals: final info.

backported := self snapshot.
[ workingCopy backportChangesTo: base info ]
on: MCChangeSelectionRequest
do: [ :e | e resume: e patch ].

ancestry := workingCopy ancestry.
self assert: ancestry ancestors size equals: 1.
self assert: ancestry ancestors first equals: base info.
self assert: ancestry stepChildren size equals: 1.
self assert: ancestry stepChildren first equals: backported info
]

{ #category : 'tests' }
MCWorkingCopyTest >> testDoubleRepeatedMerge [
| base motherA1 motherA2 motherB1 motherB2 inst |
Expand Down Expand Up @@ -250,22 +214,6 @@ MCWorkingCopyTest >> testNaming [
self assertNameWhenSavingTo: repos is: 'foo2-abc.41'.
]

{ #category : 'tests' }
MCWorkingCopyTest >> testOptimizedLoad [
| inst base diffy |
inst := self mockInstanceA.
base := self snapshot.
self change: #one toReturn: 2.
self assert: inst one equals: 2.
diffy := self snapshot asDiffAgainst: base.
self deny: diffy canOptimizeLoading.
self load: base.
self assert: inst one equals: 1.
self assert: diffy canOptimizeLoading.
self load: diffy.
self assert: inst one equals: 2
]

{ #category : 'tests' }
MCWorkingCopyTest >> testRedundantMerge [
| base |
Expand Down Expand Up @@ -311,31 +259,6 @@ MCWorkingCopyTest >> testRepositoryFallback [
self should: [ repositoryGroup versionWithInfo: version info ] raise: Error
]

{ #category : 'tests' }
MCWorkingCopyTest >> testSelectiveBackport [
| inst base intermediate final |
inst := self mockInstanceA.
base := self snapshot.
self assert: inst one equals: 1.
self change: #one toReturn: 2.
intermediate := self snapshot.
self change: #two toReturn: 3.
final := self snapshot.
[ workingCopy backportChangesTo: base info ]
on: MCChangeSelectionRequest
do: [ :e |
| patch selected |
patch := e patch.
selected := patch operations select: [ :ea | ea definition selector = #two ].
e resume: (MCPatch operations: selected) ].
self assert: inst one equals: 1.
self assert: inst two equals: 3.
self assert: workingCopy ancestry ancestors size equals: 1.
self assert: workingCopy ancestry ancestors first equals: base info.
self assert: workingCopy ancestry stepChildren size equals: 1.
self assert: workingCopy ancestry stepChildren first equals: final info
]

{ #category : 'tests' }
MCWorkingCopyTest >> testSimpleMerge [
| mother base inst |
Expand Down
20 changes: 0 additions & 20 deletions src/Monticello/MCAncestry.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,6 @@ MCAncestry >> allAncestorsDo: aBlock [
ea allAncestorsDo: aBlock]
]

{ #category : 'ancestry' }
MCAncestry >> allAncestorsOnPathTo: aVersionInfo [
^ MCFilteredVersionSorter new
target: aVersionInfo;
addAllVersionInfos: self ancestors;
sortedVersionInfos
]

{ #category : 'ancestry' }
MCAncestry >> ancestorString [
^ String streamContents:
Expand Down Expand Up @@ -134,18 +126,6 @@ MCAncestry >> stepChildrenString [
[:s | self stepChildren do: [:ea | s nextPutAll: ea name] separatedBy: [s nextPutAll: ', ']]
]

{ #category : 'ancestry' }
MCAncestry >> topologicalAncestors [

^ Array streamContents:
[:s | | f frontier |
frontier := MCFrontier frontierOn: self.
[f := frontier frontier.
s nextPutAll: f.
frontier removeAll: f.
f isEmpty] whileFalse]
]

{ #category : 'ancestry' }
MCAncestry >> withBreadthFirstAncestors [
^ (Array with: self), self breadthFirstAncestors
Expand Down
Loading