Skip to content

Commit

Permalink
Merge wip/mapper-removal-refactor into main
Browse files Browse the repository at this point in the history
  • Loading branch information
MariusDoe committed Nov 16, 2024
2 parents fb19977 + 4adfa9b commit 2aa64db
Show file tree
Hide file tree
Showing 102 changed files with 199 additions and 242 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
testing
isRemoval
^ self mapper isMissing: self assetFileToWrite
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
"assetAsAssetFile:" : "mad 10/2/2024 20:34",
"assetFileToWrite" : "mad 9/29/2024 16:51",
"assetFileToWrite:" : "mad 9/29/2024 16:53",
"canMapperBeRemovedAfterMaterializeIn:" : "mad 7/3/2024 16:27",
"canMapperBeRemovedAfterSerializeInto:" : "mad 7/3/2024 16:27",
"canMapperBeRemovedAtAll" : "mad 9/29/2024 17:00",
"change" : "mad 9/11/2023 14:39",
"changeClass" : "mad 10/9/2024 16:01",
"changes" : "mad 9/11/2023 14:38",
Expand All @@ -20,6 +17,7 @@
"isExcluded" : "mad 9/7/2023 15:29",
"isExcluded:" : "mad 9/11/2023 14:39",
"isIncluded" : "mad 9/27/2024 18:43",
"isRemoval" : "mad 11/16/2024 15:07",
"markAsEdited" : "mad 9/27/2023 16:32",
"materializeIn:" : "mad 9/29/2024 16:52",
"path" : "mad 9/5/2023 22:56",
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
changes-creation
changeSetFromAssetFile: anAssetFile toAssetFile: anotherAssetFile
(anAssetFile = anotherAssetFile) ifTrue: [^ GSEmptyChangeSet withMapper: self].
^ self changeSetClass withMapper: self from: anAssetFile to: anotherAssetFile
(anAssetFile = anotherAssetFile) ifTrue: [
^ GSEmptyChangeSet
withMapper: self
isRemoval: (self isMissing: anotherAssetFile)].
^ self changeSetClass
withMapper: self
from: anAssetFile
to: anotherAssetFile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
changes-creation
changeSetFromFSCommit: anFSCommit toFSCommit: anotherFSCommit
(self hexHashIn: anFSCommit) = (self hexHashIn: anotherFSCommit)
ifTrue: [^ GSEmptyChangeSet withMapper: self].
self
hexHashesFrom: (self hexHashIn: anFSCommit)
to: (self hexHashIn: anotherFSCommit)
ifEqual: [:emptyChangeSet | ^ emptyChangeSet].
^ self
changeSetFromAssetFile: (self loadAssetFileFrom: anFSCommit filesystem)
toAssetFile: (self loadAssetFileFrom: anotherFSCommit filesystem)
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ changes-creation
changeSetFromFSCommit: anFSCommit toImage: aWorkingCopy
| imageAssetFile |
imageAssetFile := self loadAssetFileFromImage: aWorkingCopy.
(self hexHashIn: anFSCommit) = (imageAssetFile ifNotNil: #hexHash)
ifTrue: [^ GSEmptyChangeSet withMapper: self].
self
hexHashesFrom: (self hexHashIn: anFSCommit)
to: (imageAssetFile ifNotNil: #hexHash)
ifEqual: [:emptyChangeSet | ^ emptyChangeSet].
^ self
changeSetFromAssetFile: (self loadAssetFileFrom: anFSCommit filesystem)
toAssetFile: imageAssetFile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ changes-creation
changeSetFromImage: aWorkingCopy toFSCommit: anFSCommit
| imageAssetFile |
imageAssetFile := self loadAssetFileFromImage: aWorkingCopy.
(self hexHashIn: anFSCommit) = (imageAssetFile ifNotNil: #hexHash)
ifTrue: [^ GSEmptyChangeSet withMapper: self].
self
hexHashesFrom: (imageAssetFile ifNotNil: #hexHash)
to: (self hexHashIn: anFSCommit)
ifEqual: [:emptyChangeSet | ^ emptyChangeSet].
^ self
changeSetFromAssetFile: imageAssetFile
toAssetFile: (self loadAssetFileFrom: anFSCommit filesystem)
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ changeSetToMergeAssetFile: right into: left withBase: base
atomicMergeLeft: left
right: right
base: base
ifUnchanged: [GSEmptyChangeSet withMapper: self]
ifUnchanged: [GSEmptyChangeSet withMapper: self isRemoval: (self isMissing: left)]
ifMerged: [:merged | GSAssetChangeSet withMapper: self from: left to: merged]
ifConflict: [:conflict | GSConflictingAssetChangeSet withMapper: self conflict: conflict]
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ changes-creation
changeSetToMergeFSCommit: rightFSCommit into: leftFSCommit withBase: baseFSCommit
| left right base |
GSMergeUtilities
hexHashMerge: [:commit | self hexHashIn: commit]
hexHashMergeFor: self
left: leftFSCommit
right: rightFSCommit
base: baseFSCommit
ifUnchanged: [^ GSEmptyChangeSet withMapper: self].
ifUnchanged: [:emptyChangeSet | ^ emptyChangeSet].
left := self loadAssetFileFrom: leftFSCommit filesystem.
right := self loadAssetFileFrom: rightFSCommit filesystem.
base := self loadAssetFileFrom: baseFSCommit filesystem.
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
changes-creation
hexHashPath
^ self path
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
testing
isMissing: anAssetFileOrNil
^ anAssetFileOrNil isNil
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
asset-creation
loadAssetFileFrom: aFileSystem
| reference |
reference := aFileSystem referenceTo: self path.
reference := self referenceIn: aFileSystem.
reference isFile ifFalse: [^ nil].
^ reference readStreamDo: [:stream |
(self canReadAssetFrom: stream) ifFalse: [^ nil].
self readAssetFrom: stream. "check for errors (will be thrown)"
stream reset.
GSAssetFile withMapper: self fromStream: stream]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
asset-creation
referenceIn: aFileSystem
^ aFileSystem referenceTo: self path
21 changes: 10 additions & 11 deletions src/GitS-Core.package/GSAssetMapper.class/methodProperties.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,30 +30,28 @@
"buildAsset:with:" : "mad 9/29/2024 17:36",
"buildAssetFile:with:" : "mad 10/2/2024 18:07",
"buildAssetFromImage:with:" : "mad 9/29/2024 17:42",
"canBeRemovedAfterMaterializeIn:" : "mad 9/29/2024 17:00",
"canBeRemovedAfterSerializeInto:" : "mad 9/29/2024 17:00",
"canBeRemovedForAssetFile:" : "mad 9/29/2024 16:59",
"canMigrateMaterialized:" : "mad 10/11/2024 14:27",
"canReadAssetFrom:" : "mad 9/29/2024 17:38",
"changeSetClass" : "mad 10/9/2024 16:01",
"changeSetFromAssetFile:toAssetFile:" : "mad 10/9/2024 16:01",
"changeSetFromFSCommit:toFSCommit:" : "mad 10/9/2024 16:01",
"changeSetFromFSCommit:toImage:" : "mad 10/9/2024 16:01",
"changeSetFromImage:toFSCommit:" : "mad 10/9/2024 16:01",
"changeSetToMergeAssetFile:into:withBase:" : "mad 10/9/2024 16:01",
"changeSetToMergeFSCommit:into:withBase:" : "mad 10/9/2024 16:01",
"changeSetFromAssetFile:toAssetFile:" : "mad 11/16/2024 15:07",
"changeSetFromFSCommit:toFSCommit:" : "mad 11/12/2024 15:05",
"changeSetFromFSCommit:toImage:" : "mad 11/12/2024 15:05",
"changeSetFromImage:toFSCommit:" : "mad 11/12/2024 15:24",
"changeSetToMergeAssetFile:into:withBase:" : "mad 11/16/2024 15:07",
"changeSetToMergeFSCommit:into:withBase:" : "mad 11/12/2024 15:02",
"contentsAsAssetFile:" : "mad 10/9/2024 16:01",
"doPostUpdateMigrationsIn:" : "mad 9/27/2024 22:47",
"encoding" : "mad 9/20/2023 18:39",
"encoding:" : "mad 9/20/2023 18:43",
"encodingName" : "mad 9/20/2023 19:02",
"hash" : "mad 9/20/2023 18:59",
"hexHashIn:" : "mad 10/1/2024 22:56",
"hexHashPath" : "mad 11/12/2024 14:52",
"importPriority" : "mad 4/22/2024 16:43",
"initialize" : "mad 9/20/2023 18:55",
"isMissing:" : "mad 11/16/2024 15:06",
"isValidAsset:" : "mad 9/29/2024 17:39",
"kind" : "mad 9/29/2024 19:28",
"loadAssetFileFrom:" : "mad 10/9/2024 23:11",
"loadAssetFileFrom:" : "mad 11/12/2024 19:10",
"loadAssetFileFromImage:" : "mad 9/29/2024 16:35",
"loadAssetFromImage:" : "mad 9/29/2024 17:42",
"mappedPathPatterns" : "mad 10/9/2024 16:01",
Expand All @@ -74,6 +72,7 @@
"printEncodedUsingOn:" : "mad 11/6/2023 13:17",
"printKindOn:" : "mad 9/30/2024 14:15",
"readAssetFrom:" : "mad 9/29/2024 17:44",
"referenceIn:" : "mad 11/12/2024 14:57",
"removeIn:" : "mad 9/27/2024 19:39",
"sarAssetFileVariableName" : "mad 10/6/2024 21:58",
"sarAssetsFileName" : "mad 10/6/2024 21:51",
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
testing
isIncludedRemoval
^ (self changes allSatisfy: #isIncluded) and: [self isRemoval]
3 changes: 3 additions & 0 deletions src/GitS-Core.package/GSChangeSet.class/instance/isRemoval.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
testing
isRemoval
self subclassResponsibility.
5 changes: 3 additions & 2 deletions src/GitS-Core.package/GSChangeSet.class/methodProperties.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
"isAbstract" : "mad 10/13/2024 20:53",
"withMapper:" : "mad 9/6/2023 12:45" },
"instance" : {
"canMapperBeRemovedAfterMaterializeIn:" : "mad 2/20/2024 15:33",
"canMapperBeRemovedAfterSerializeInto:" : "mad 2/20/2024 13:58",
"canMapperBeRemovedAtAll" : "mad 11/12/2024 14:35",
"changes" : "mad 9/5/2023 22:51",
"hasConflicts" : "mad 9/27/2023 16:06",
"hasIncludedConflicts" : "mad 9/27/2023 16:12",
"isEmpty" : "mad 9/27/2024 17:00",
"isIncludedRemoval" : "mad 11/12/2024 14:44",
"isRemoval" : "mad 11/12/2024 14:44",
"mapper" : "mad 9/1/2023 17:25",
"mapper:" : "mad 9/1/2023 17:25",
"materializeIn:" : "mad 9/5/2023 22:51",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
instance creation
withMapper: aMapper operations: aCollection
withMapper: aMapper from: aSnapshot operations: aCollection
^ (self withMapper: aMapper)
from: aSnapshot;
addOperations: aCollection;
yourself
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
instance creation
withMapper: aMapper from: aSnapshot operations: aCollection conflicts: anotherCollection
^ (self withMapper: aMapper from: aSnapshot operations: aCollection)
addConflicts: anotherCollection;
yourself
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
instance creation
withMapper: aMapper from: aSnapshot patch: anMCPatch
^ self
withMapper: aMapper
from: aSnapshot
operations: anMCPatch operations

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

3 changes: 3 additions & 0 deletions src/GitS-Core.package/GSCodeChangeSet.class/instance/from..st
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
from: aSnapshot
from := aSnapshot
3 changes: 3 additions & 0 deletions src/GitS-Core.package/GSCodeChangeSet.class/instance/from.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
from
^ from
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
isRemoval
^ self mapper isEmpty: (MCPatcher apply: self patch to: self from)
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
{
"class" : {
"withMapper:operations:" : "mad 9/7/2023 16:02",
"withMapper:operations:conflicts:" : "mad 9/7/2023 19:55",
"withMapper:patch:" : "mad 9/7/2023 16:02" },
"withMapper:from:operations:" : "mad 11/12/2024 15:14",
"withMapper:from:operations:conflicts:" : "mad 11/12/2024 15:14",
"withMapper:from:patch:" : "mad 11/16/2024 14:57" },
"instance" : {
"addConflicts:" : "mad 10/9/2024 16:01",
"addOperations:" : "mad 10/9/2024 16:01",
"addPatch:" : "mad 9/7/2023 16:04",
"canBeRemovedForSnapshot:" : "mad 2/20/2024 15:36",
"canMapperBeRemovedAfterMaterializeIn:" : "mad 2/20/2024 15:39",
"canMapperBeRemovedAfterSerializeInto:" : "mad 2/20/2024 15:38",
"changedSnapshotForCurrentSnapshot:" : "mad 10/9/2024 17:04",
"changedSnapshotForMaterializeIn:" : "mad 2/20/2024 17:35",
"changedSnapshotForSerializeInto:" : "mad 2/20/2024 17:35",
"changes" : "mad 9/7/2023 16:05",
"changes:" : "mad 9/7/2023 16:05",
"from" : "mad 11/12/2024 15:11",
"from:" : "mad 11/12/2024 15:17",
"initialize" : "mad 9/7/2023 20:08",
"isRemoval" : "mad 11/16/2024 15:06",
"materializeIn:" : "mad 10/9/2024 17:04",
"operations" : "mad 9/10/2023 18:58",
"package" : "mad 9/6/2023 19:18",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
],
"commentStamp" : "",
"instvars" : [
"from",
"changes" ],
"name" : "GSCodeChangeSet",
"pools" : [
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
changes-creation
changeSetFromFSCommit: anFSCommit toFSCommit: anotherFSCommit
(self hexHashIn: anFSCommit) = (self hexHashIn: anotherFSCommit)
ifTrue: [^ GSEmptyChangeSet withMapper: self].
self
hexHashesFrom: (self hexHashIn: anFSCommit)
to: (self hexHashIn: anotherFSCommit)
ifEqual: [:emptyChangeSet | ^ emptyChangeSet].
^ self
changeSetFromSnapshot: (self loadSnapshotFrom: anFSCommit filesystem)
toSnapshot: (self loadSnapshotFrom: anotherFSCommit filesystem)
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@ changes-creation
changeSetFromSnapshot: aSnapshot toSnapshot: anotherSnapshot
| patch |
patch := anotherSnapshot patchRelativeToBase: aSnapshot.
patch isEmpty ifTrue: [^ GSEmptyChangeSet withMapper: self].
^ GSCodeChangeSet withMapper: self patch: patch
patch isEmpty ifTrue: [^ GSEmptyChangeSet
withMapper: self
isRemoval: (self isEmpty: anotherSnapshot)].
^ GSCodeChangeSet withMapper: self from: aSnapshot patch: patch.
Loading

0 comments on commit 2aa64db

Please sign in to comment.