From 4d6c1b600a2b6a9dd737ffbddae6e30d6e3bee66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20D=C3=B6rbandt?= Date: Wed, 10 Jul 2024 20:13:22 +0200 Subject: [PATCH] Fix wrong handling of nil merge result in SquotPlaintextMapper --- .../instance/mergeVersion.into.withBase..st | 7 +++---- .../instance/transformVersion..st | 3 +++ .../instance/transformVersion.ifFail..st | 4 ++-- .../SquotPlaintextMapper.class/methodProperties.json | 5 +++-- 4 files changed, 11 insertions(+), 8 deletions(-) create mode 100644 src/Squot.package/SquotPlaintextMapper.class/instance/transformVersion..st diff --git a/src/Squot.package/SquotPlaintextMapper.class/instance/mergeVersion.into.withBase..st b/src/Squot.package/SquotPlaintextMapper.class/instance/mergeVersion.into.withBase..st index a06f0a65d..ac32a6c73 100644 --- a/src/Squot.package/SquotPlaintextMapper.class/instance/mergeVersion.into.withBase..st +++ b/src/Squot.package/SquotPlaintextMapper.class/instance/mergeVersion.into.withBase..st @@ -1,15 +1,14 @@ merging mergeVersion: right into: left withBase: base | merged | - merged := self toPlaintext: - ((SquotMergeUtilities + merged := self transformVersion: + (SquotMergeUtilities stringOrNilMergeLeft: left right: right base: base ifConflict: [^ SquotPlaintextConflictChangeSet withMapper: self - conflict: (SquotMergeConflict left: left right: right base: base)]) - ifNil: [^ nil]). + conflict: (SquotMergeConflict left: left right: right base: base)]). ^ (merged squotEqual: left) ifTrue: [SquotEmptyChangeSet withMapper: self] ifFalse: [SquotPlaintextNormalChangeSet withMapper: self from: left to: merged] \ No newline at end of file diff --git a/src/Squot.package/SquotPlaintextMapper.class/instance/transformVersion..st b/src/Squot.package/SquotPlaintextMapper.class/instance/transformVersion..st new file mode 100644 index 000000000..4e6f86c24 --- /dev/null +++ b/src/Squot.package/SquotPlaintextMapper.class/instance/transformVersion..st @@ -0,0 +1,3 @@ +ui +transformVersion: aStringOrNil + ^ self toPlaintext: (aStringOrNil ifNil: [^ nil]) \ No newline at end of file diff --git a/src/Squot.package/SquotPlaintextMapper.class/instance/transformVersion.ifFail..st b/src/Squot.package/SquotPlaintextMapper.class/instance/transformVersion.ifFail..st index 24a9dacff..be325fcae 100644 --- a/src/Squot.package/SquotPlaintextMapper.class/instance/transformVersion.ifFail..st +++ b/src/Squot.package/SquotPlaintextMapper.class/instance/transformVersion.ifFail..st @@ -1,3 +1,3 @@ ui -transformVersion: aString ifFail: aBlock - ^ self toPlaintext: (aString ifNil: [^ nil]) \ No newline at end of file +transformVersion: aStringOrNil ifFail: aBlock + ^ self transformVersion: aStringOrNil \ No newline at end of file diff --git a/src/Squot.package/SquotPlaintextMapper.class/methodProperties.json b/src/Squot.package/SquotPlaintextMapper.class/methodProperties.json index b294bc31c..2d34ae6e0 100644 --- a/src/Squot.package/SquotPlaintextMapper.class/methodProperties.json +++ b/src/Squot.package/SquotPlaintextMapper.class/methodProperties.json @@ -14,7 +14,7 @@ "importPriority" : "mad 4/22/2024 16:43", "isSourceAt:timeStampOf:" : "mad 11/7/2023 14:42", "isValidVersion:" : "mad 11/6/2023 13:22", - "mergeVersion:into:withBase:" : "mad 7/10/2024 17:08", + "mergeVersion:into:withBase:" : "mad 7/10/2024 20:08", "pathFor:" : "mad 11/7/2023 14:42", "printOn:" : "mad 11/7/2023 12:47", "printWithoutPathOn:" : "mad 11/7/2023 12:47", @@ -22,7 +22,8 @@ "sourcesSizeOf:" : "mad 11/7/2023 14:41", "stylerClassFor:at:" : "mad 11/7/2023 14:41", "toPlaintext:" : "mad 11/7/2023 14:40", - "transformVersion:ifFail:" : "mad 12/20/2023 15:03", + "transformVersion:" : "mad 7/10/2024 20:08", + "transformVersion:ifFail:" : "mad 7/10/2024 20:08", "versionAsMorph:" : "mad 11/7/2023 14:49", "versionAsSources:" : "mad 11/7/2023 14:41", "versionTypeName" : "mad 11/7/2023 12:53",