Skip to content

Commit

Permalink
WIP: Metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
MariusDoe committed Jun 12, 2024
1 parent e447b42 commit eea1ee8
Show file tree
Hide file tree
Showing 116 changed files with 468 additions and 107 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
registering
deriveName: aString
| current suffix |
current := aString.
suffix := 2.
[self isNameRegistered: current] whileTrue: [
current := aString, suffix.
suffix := suffix + 1].
^ current
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
accessing
allMappers
^ self mappers, {self mappersMapper}
^ self mappers, {self metadataMapper}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
changes-creation
changeSetsFromFSCommit: anFSCommit toFSCommit: anotherFSCommit
^ self mappersMapper
^ self metadataMapper
changeSetsFromFSCommit: anFSCommit
toFSCommit: anotherFSCommit
in: self
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
changes-creation
changeSetsFromFSCommitToImage: anFSCommit
^ self mappersMapper changeSetsFromFSCommit: anFSCommit toImage: self
^ self metadataMapper changeSetsFromFSCommit: anFSCommit toImage: self
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
changes-creation
changeSetsFromImageToFSCommit: anFSCommit
^ self mappersMapper changeSetsFromImage: self toFSCommit: anFSCommit
^ self metadataMapper changeSetsFromImage: self toFSCommit: anFSCommit
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ commitImportedMappers: aCollection on: aCommit
| commitMessage emptyChangeSets mappersChangeSet |
emptyChangeSets := Dictionary newFrom:
(aCollection collect: [:each | each -> (SquotEmptyChangeSet withMapper: each)]).
mappersChangeSet := self mappersMapper
mappersChangeSet := self metadataMapper
changeSetFromMappers: {}
removing: {}
changeSets: emptyChangeSets.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
accessing
deriveName: aString
| derived |
derived := self class deriveName: aString.
self name: derived.
^ derived
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ importing
importSquotContentsFromCommit: aCommit
| filesystem readStream loadOrder newMappers |
filesystem := self filesystemOn: aCommit.
(self mappersMapper hasMappersFile: filesystem) ifTrue: [^ nil].
(self metadataMapper hasAnyFile: filesystem) ifTrue: [^ nil].
readStream := [filesystem readStreamOn: '.squot'] on: FileDoesNotExist do: [^ nil].
loadOrder := STON fromStream: readStream.
loadOrder ifEmpty: [^ nil].
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
git-operations
mergeFSCommit: rightFSCommit into: leftFSCommit withBase: baseFSCommit
^ self mappersMapper
^ self metadataMapper
mergeCommit: rightFSCommit
into: leftFSCommit
withBase: baseFSCommit
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
accessing
metadata: aMetadata
self
nameIfTakenDeriveAndInform: aMetadata name;
mappers: aMetadata mappers copy.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
accessing
metadata
^ SquotMetadata new
name: self name;
mappers: self mappers copy;
yourself
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
mappers
metadataMapper
^ SquotMetadataMapper new
9 changes: 1 addition & 8 deletions src/Squot.package/SqueakWorkingCopy.class/instance/name..st
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
accessing
name: aString
self name = aString ifTrue: [^ self].
self isRegistered ifFalse: [^ self basicName: aString].
(self class isNameRegistered: aString)
ifTrue: [^ self error: 'Cannot rename to a name that is already taken.'].
self
unregister;
basicName: aString;
register.
self name: aString ifTaken: [self error: 'Cannot rename to a name that is already taken.'].
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
accessing
name: aString ifTaken: aBlock
self name = aString ifTrue: [^ self].
self isRegistered ifFalse: [^ self basicName: aString].
(self class isNameRegistered: aString) ifTrue: [^ aBlock value].
self
unregister;
basicName: aString;
register.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
accessing
name: aString ifTakenDeriveAnd: aBlock
self name: aString ifTaken: [ | derived |
derived := self deriveName: aString.
aBlock cull: derived].
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
accessing
nameIfTakenDeriveAndInform: aString
self name: aString ifTakenDeriveAnd: [:derived |
self inform: ('The project name {1} is already taken. The project has been renamed to {2}.'
format: {aString printString. derived printString})].
25 changes: 16 additions & 9 deletions src/Squot.package/SqueakWorkingCopy.class/methodProperties.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"cloneFrom:to:named:" : "mad 9/19/2023 11:53",
"cloneFromUserAndRegister" : "mad 6/12/2024 11:59",
"defaultDirectoryForName:" : "mad 10/22/2023 00:24",
"deriveName:" : "mad 6/12/2024 13:28",
"doPostUpdateMigrations" : "mad 11/21/2023 16:06",
"gitSuffix" : "mad 11/13/2023 12:03",
"handleMovedImageFrom:to:" : "mad 11/28/2023 19:23",
Expand Down Expand Up @@ -33,7 +34,7 @@
"instance" : {
"actionAddRemote" : "mad 10/16/2023 20:49",
"addMapper:" : "mad 9/20/2023 17:30",
"allMappers" : "mad 10/21/2023 22:58",
"allMappers" : "mad 6/11/2024 18:29",
"allReferences" : "mad 11/30/2023 21:44",
"basicHeadRef" : "mad 11/30/2023 13:15",
"basicName:" : "mad 12/8/2023 17:30",
Expand All @@ -42,11 +43,11 @@
"buildSar" : "mad 11/14/2023 18:33",
"changeSetsFromCommit:toCommit:" : "mad 9/6/2023 19:28",
"changeSetsFromCommitToImage:" : "mad 9/6/2023 19:28",
"changeSetsFromFSCommit:toFSCommit:" : "mad 9/20/2023 12:51",
"changeSetsFromFSCommitToImage:" : "mad 9/20/2023 12:42",
"changeSetsFromFSCommit:toFSCommit:" : "mad 6/11/2024 18:29",
"changeSetsFromFSCommitToImage:" : "mad 6/11/2024 18:29",
"changeSetsFromHeadCommitToImage" : "mad 9/6/2023 19:29",
"changeSetsFromImageToCommit:" : "mad 9/6/2023 19:29",
"changeSetsFromImageToFSCommit:" : "mad 9/20/2023 12:44",
"changeSetsFromImageToFSCommit:" : "mad 6/11/2024 18:30",
"changeSetsFromImageToHeadCommit" : "mad 4/7/2024 15:33",
"checkCanDeleteRef:" : "mad 10/16/2023 22:52",
"checkForMissingHead" : "mad 3/19/2024 21:45",
Expand All @@ -57,13 +58,14 @@
"cloneFrom:" : "mad 5/23/2024 21:00",
"commitChangeSets:message:additionalParents:onlyAdditionalParents:" : "mad 4/29/2024 20:55",
"commitChangeSets:onCommit:message:additionalParents:onlyAdditionalParents:" : "mad 4/5/2024 00:19",
"commitImportedMappers:on:" : "mad 4/29/2024 22:24",
"commitImportedMappers:on:" : "mad 6/11/2024 18:30",
"computeRefsForCommits" : "mad 9/11/2023 16:47",
"createBranchNamed:at:" : "mad 10/16/2023 21:32",
"credentials" : "mad 9/18/2023 12:52",
"credentials:" : "mad 9/18/2023 12:52",
"currentHeadTarget" : "mad 11/30/2023 13:17",
"currentSymbolicHeadTarget" : "mad 11/30/2023 13:17",
"deriveName:" : "mad 6/12/2024 13:32",
"doImageHashMigration" : "mad 11/29/2023 15:09",
"doPostUpdateMigrations" : "mad 11/29/2023 15:07",
"emptyCommit" : "mad 5/20/2023 21:22",
Expand Down Expand Up @@ -94,7 +96,7 @@
"imageHash" : "mad 11/28/2023 19:19",
"import" : "mad 4/29/2024 20:40",
"importSquotContents:from:into:fallbackSerializer:" : "mad 4/29/2024 21:39",
"importSquotContentsFromCommit:" : "mad 4/29/2024 21:41",
"importSquotContentsFromCommit:" : "mad 6/12/2024 13:37",
"importSquotContentsFromHeadCommit" : "mad 4/29/2024 20:55",
"initialRemoteRefNameFor:" : "mad 9/18/2023 13:58",
"initialize" : "mad 11/28/2023 19:19",
Expand All @@ -113,7 +115,6 @@
"mappedPaths" : "mad 10/21/2023 22:58",
"mappers" : "mad 6/1/2023 22:35",
"mappers:" : "mad 3/19/2024 21:25",
"mappersMapper" : "mad 9/20/2023 12:47",
"mappersOfKind:" : "mad 9/20/2023 17:29",
"materializeChangeSets:" : "mad 4/29/2024 23:00",
"materializeCommit:" : "mad 9/6/2023 19:27",
Expand All @@ -125,10 +126,16 @@
"materializedMappers" : "mad 6/1/2023 22:36",
"mergeCommit:into:withBase:" : "mad 8/23/2023 19:49",
"mergeCommitIntoHead:withBase:" : "mad 4/5/2024 15:00",
"mergeFSCommit:into:withBase:" : "mad 9/20/2023 13:01",
"mergeFSCommit:into:withBase:" : "mad 6/11/2024 18:30",
"metadata" : "mad 6/11/2024 18:37",
"metadata:" : "mad 6/12/2024 13:34",
"metadataMapper" : "mad 6/11/2024 18:29",
"moveToNewRepositoryLocation:" : "mad 12/22/2023 17:50",
"name" : "mad 9/19/2023 11:52",
"name:" : "mad 12/8/2023 17:31",
"name:" : "mad 6/12/2024 13:25",
"name:ifTaken:" : "mad 6/12/2024 13:25",
"name:ifTakenDeriveAnd:" : "mad 6/12/2024 13:33",
"nameIfTakenDeriveAndInform:" : "mad 6/12/2024 13:35",
"pushRef:force:" : "mad 5/18/2024 11:31",
"refChanged:" : "mad 5/15/2024 21:20",
"refName:" : "mad 6/3/2023 14:17",
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
newValueAfterMaterializeIn: aWorkingCopy
^ self newMappersAfterMaterializeIn: aWorkingCopy
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
newValueAfterSerializeInto: aFileSystem
^ self newMappersAfterSerializeInto: aFileSystem
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
property
^ #mappers

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
"changes" : "mad 9/20/2023 12:04",
"mapperChangeSets" : "mad 2/20/2024 14:51",
"mapperChangeSets:" : "mad 2/20/2024 14:51",
"materializeIn:" : "mad 2/20/2024 15:50",
"newMappers" : "mad 2/20/2024 15:30",
"newMappersAfterMaterializeIn:" : "mad 2/20/2024 15:32",
"newMappersAfterSerializeInto:" : "mad 2/20/2024 15:31",
"newMappersWithRemovalCheck:" : "mad 2/20/2024 15:30",
"newValueAfterMaterializeIn:" : "mad 6/12/2024 14:06",
"newValueAfterSerializeInto:" : "mad 6/12/2024 14:06",
"oldMappers" : "mad 9/20/2023 12:00",
"oldMappers:" : "mad 9/20/2023 12:00",
"potentiallyRemovedMappers" : "mad 2/20/2024 15:00",
"potentiallyRemovedMappers:" : "mad 2/20/2024 15:00",
"referenceIn:" : "mad 9/20/2023 12:02",
"serializeInto:" : "mad 2/20/2024 15:31" } }
"property" : "mad 6/12/2024 14:12" } }
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
"name" : "SquotMappersChangeSet",
"pools" : [
],
"super" : "SquotChangeSet",
"super" : "SquotMetadataPropertyChangeSet",
"type" : "normal" }

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

25 changes: 0 additions & 25 deletions src/Squot.package/SquotMappersMapper.class/methodProperties.json

This file was deleted.

3 changes: 3 additions & 0 deletions src/Squot.package/SquotMetadata.class/class/currentVersion.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
currentVersion
^ 1
6 changes: 6 additions & 0 deletions src/Squot.package/SquotMetadata.class/instance/^equals.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
comparing
= anObject
self class = anObject class ifFalse: [^ false].
self name = anObject name ifFalse: [^ false].
self mappers asSet = anObject mappers asSet ifFalse: [^ false].
^ true
3 changes: 3 additions & 0 deletions src/Squot.package/SquotMetadata.class/instance/hash.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
comparing
hash
^ self name hash bitXor: self mappers asSet hash
4 changes: 4 additions & 0 deletions src/Squot.package/SquotMetadata.class/instance/initialize.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
initialize-release
initialize
super initialize.
self version ifNotNil: [self setCurrentVersion].
3 changes: 3 additions & 0 deletions src/Squot.package/SquotMetadata.class/instance/mappers..st
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
mappers: anOrderedCollection
mappers := anOrderedCollection
3 changes: 3 additions & 0 deletions src/Squot.package/SquotMetadata.class/instance/mappers.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
mappers
^ mappers
3 changes: 3 additions & 0 deletions src/Squot.package/SquotMetadata.class/instance/name..st
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
name: aString
name := aString
3 changes: 3 additions & 0 deletions src/Squot.package/SquotMetadata.class/instance/name.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
name
^ name
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
setCurrentVersion
self version: self class currentVersion.
3 changes: 3 additions & 0 deletions src/Squot.package/SquotMetadata.class/instance/version..st
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
version: aNumber
version := aNumber
3 changes: 3 additions & 0 deletions src/Squot.package/SquotMetadata.class/instance/version.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
version
^ version
Loading

0 comments on commit eea1ee8

Please sign in to comment.