Skip to content

Commit

Permalink
WIP: collisions
Browse files Browse the repository at this point in the history
  • Loading branch information
MariusDoe committed Oct 11, 2024
1 parent f03a11b commit dc02fce
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
collisions
collidingMappersAfterSerializeInto: aFileSystem
| mappersChangeSet |
mappersChangeSet := self changeSets
detect: [:each | each isKindOf: SquotMetadataMappersChangeSet]
ifNone: [^ {}].
^ mappersChangeSet collidingMappersAfterSerializeInto: aFileSystem
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"canMapperBeRemovedAfterSerializeInto:" : "mad 8/15/2024 18:35",
"canMapperBeRemovedAtAll" : "mad 8/15/2024 18:35",
"changes" : "mad 8/24/2024 19:01",
"collidingMappersAfterSerializeInto:" : "mad 10/7/2024 14:24",
"legacyReferencesIn:" : "mad 10/9/2024 18:02",
"materializeIn:" : "mad 8/18/2024 18:47",
"metadataReferenceIn:" : "mad 10/9/2024 17:18",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
collisions
collidingMappersAfterSerializeInto: aFileSystem
| mappers seen |
mappers := self newMappersAfterSerializeInto: aFileSystem.
seen := Dictionary new.
^ Array streamContents: [:stream |
mappers do: [:mapperA | | pathPatternsA |
pathPatternsA := mapperA mappedPathPatterns.
seen keysAndValuesDo: [:mapperB :pathPatternsB |
(pathPatternsA anySatisfy: [:pathPatternA |
pathPatternsB anySatisfy: [:pathPatternB |
pathPatternA collidesWith: pathPatternB]])
ifTrue: [stream nextPut: {mapperA. mapperB}]].
seen at: mapperA put: pathPatternsA]]
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"allMappers" : "mad 9/30/2024 15:00",
"bumpMapperVersionIfNecessary:" : "mad 9/27/2024 17:45",
"changes" : "mad 10/9/2024 16:01",
"collidingMappersAfterSerializeInto:" : "mad 10/7/2024 14:32",
"isEmpty" : "mad 10/1/2024 14:42",
"mapperChangeSets" : "mad 2/20/2024 14:51",
"mapperChangeSets:" : "mad 2/20/2024 14:51",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
testing
collidesWith: aPathPattern
(self allowsLeading or: [aPathPattern allowsLeading])
ifTrue: ["ignore these for now, currently only used to catch .squot-contents" ^ false].
1 to: (self path size clampHigh: aPathPattern path size) do: [:index |
(self path at: index) = (aPathPattern path at: index) ifFalse: [^ false]].
^ true
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"allowsLeading:" : "mad 10/4/2024 15:25",
"allowsTrailing" : "mad 10/4/2024 15:24",
"allowsTrailing:" : "mad 10/4/2024 15:25",
"collidesWith:" : "mad 10/7/2024 14:20",
"disallowLeading" : "mad 10/4/2024 15:25",
"disallowTrailing" : "mad 10/4/2024 15:25",
"matches:" : "mad 10/4/2024 15:42",
Expand Down

0 comments on commit dc02fce

Please sign in to comment.