From c08f13dee889577d8952321b82941b0e0f6beccd Mon Sep 17 00:00:00 2001 From: Guille Polito Date: Tue, 26 Jun 2018 11:42:22 +0200 Subject: [PATCH] Add tests for #880 --- .../instance/iceVersion..st | 8 ++------ .../instance/subdirectoryPath.st | 4 ++++ .../instance/subdirectoryReference.st | 4 ++++ .../instance/newRepositoryNamed..st | 2 +- .../instance/newRepositoryNamed.withSubdirectory..st | 4 ++++ .../instance/initialize.st | 4 ++++ .../instance/setUp.st | 2 +- .../instance/subdirectory..st | 4 ++++ .../instance/subdirectory.st | 4 ++++ .../IceBasicRepositoryFixture.class/properties.json | 3 ++- ...d..st => newRepositoryNamed.withSubdirectory..st} | 3 ++- ...d..st => newRepositoryNamed.withSubdirectory..st} | 4 ++-- .../README.md | 0 .../instance/newFixture.st | 6 ++++++ .../instance/testCodeSubdirectoryIsRoot.st | 4 ++++ .../properties.json | 11 +++++++++++ .../README.md | 0 .../instance/newFixture.st | 6 ++++++ .../properties.json | 11 +++++++++++ ...ngeClassSideMakesChangesContainClassDefinition.st | 10 +++++----- .../testChangeClassSideMakesIsExportedInCommit.st | 8 ++++---- ...ClassSideMakesIsExportedInCommitSecondVariable.st | 10 +++++----- ...angeClassWithTraitsSideMakesIsExportedInCommit.st | 10 +++++----- ...raitsSideMakesIsExportedInCommitSecondVariable.st | 10 +++++----- ...ClassInImageMakesChangesContainClassDefinition.st | 10 +++++----- ...eExtensionMethodMakesExtensionMethodAsAddition.st | 12 ++++++------ ...testRemoveExtensionMethodMakesExtensionRemoval.st | 12 ++++++------ .../instance/testRemovePackageRemovesIt.st | 2 +- ...testRevertSingleDefinitionRevertsClassAddition.st | 2 +- .../testRevertSingleDefinitionRevertsClassRemoval.st | 2 +- ...rtSingleDefinitionRevertsClassSlotModification.st | 2 +- ...estRevertSingleDefinitionRevertsMethodAddition.st | 2 +- ...evertSingleDefinitionRevertsMethodModification.st | 2 +- ...testRevertSingleDefinitionRevertsMethodRemoval.st | 2 +- .../instance/ensureSourceCodeDirectoryIn..st | 4 ++-- .../IceDiff.class/instance/isCodeSubdirectory..st | 2 +- .../instance/firstNodeSuchThat..st | 4 ++++ .../instance/firstNodeSuchThat.ifNone..st | 7 +++++++ Iceberg.package/IceEmptyNode.class/instance/path.st | 4 ++++ .../IceUnbornProject.class/instance/packagesFrom..st | 5 ----- 40 files changed, 138 insertions(+), 68 deletions(-) create mode 100644 Iceberg-Libgit.package/IceLibgitRepository.class/instance/subdirectoryPath.st create mode 100644 Iceberg-Libgit.package/IceLibgitRepository.class/instance/subdirectoryReference.st create mode 100644 Iceberg-Tests.package/IceAbstractTestFactory.class/instance/newRepositoryNamed.withSubdirectory..st create mode 100644 Iceberg-Tests.package/IceBasicRepositoryFixture.class/instance/initialize.st create mode 100644 Iceberg-Tests.package/IceBasicRepositoryFixture.class/instance/subdirectory..st create mode 100644 Iceberg-Tests.package/IceBasicRepositoryFixture.class/instance/subdirectory.st rename Iceberg-Tests.package/IceGitTestFactory.class/instance/{newRepositoryNamed..st => newRepositoryNamed.withSubdirectory..st} (87%) rename Iceberg-Tests.package/IceInMemoryTestFactory.class/instance/{newRepositoryNamed..st => newRepositoryNamed.withSubdirectory..st} (62%) create mode 100644 Iceberg-Tests.package/IceSinglePackageLocalGitRepositoryWithDotSubdirectoryTest.class/README.md create mode 100644 Iceberg-Tests.package/IceSinglePackageLocalGitRepositoryWithDotSubdirectoryTest.class/instance/newFixture.st create mode 100644 Iceberg-Tests.package/IceSinglePackageLocalGitRepositoryWithDotSubdirectoryTest.class/instance/testCodeSubdirectoryIsRoot.st create mode 100644 Iceberg-Tests.package/IceSinglePackageLocalGitRepositoryWithDotSubdirectoryTest.class/properties.json create mode 100644 Iceberg-Tests.package/IceSinglePackageLocalGitRepositoryWithSubdirectoryTest.class/README.md create mode 100644 Iceberg-Tests.package/IceSinglePackageLocalGitRepositoryWithSubdirectoryTest.class/instance/newFixture.st create mode 100644 Iceberg-Tests.package/IceSinglePackageLocalGitRepositoryWithSubdirectoryTest.class/properties.json create mode 100644 Iceberg.package/IceEmptyNode.class/instance/firstNodeSuchThat..st create mode 100644 Iceberg.package/IceEmptyNode.class/instance/firstNodeSuchThat.ifNone..st create mode 100644 Iceberg.package/IceEmptyNode.class/instance/path.st delete mode 100644 Iceberg.package/IceUnbornProject.class/instance/packagesFrom..st diff --git a/Iceberg-Libgit-Tonel.package/IceLibgitTonelReader.class/instance/iceVersion..st b/Iceberg-Libgit-Tonel.package/IceLibgitTonelReader.class/instance/iceVersion..st index 3281430f58..750c34666c 100644 --- a/Iceberg-Libgit-Tonel.package/IceLibgitTonelReader.class/instance/iceVersion..st +++ b/Iceberg-Libgit-Tonel.package/IceLibgitTonelReader.class/instance/iceVersion..st @@ -1,13 +1,9 @@ accessing iceVersion: anObject - | repository packageDirectoryName directoryName | + | repository packageDirectoryName | iceVersion := anObject. repository := iceVersion commit repository. package := iceVersion package. packageDirectoryName := iceVersion commit writerClass directoryNameFor: package. - directoryName := repository subdirectory isEmptyOrNil - ifTrue: [ packageDirectoryName ] - ifFalse: [ repository subdirectory, '/', packageDirectoryName ]. - - self packageDirectory: directoryName \ No newline at end of file + self packageDirectory: (repository subdirectoryPath / packageDirectoryName) pathString \ No newline at end of file diff --git a/Iceberg-Libgit.package/IceLibgitRepository.class/instance/subdirectoryPath.st b/Iceberg-Libgit.package/IceLibgitRepository.class/instance/subdirectoryPath.st new file mode 100644 index 0000000000..37f17238b6 --- /dev/null +++ b/Iceberg-Libgit.package/IceLibgitRepository.class/instance/subdirectoryPath.st @@ -0,0 +1,4 @@ +API-accessing +subdirectoryPath + + ^ RelativePath with: self subdirectory \ No newline at end of file diff --git a/Iceberg-Libgit.package/IceLibgitRepository.class/instance/subdirectoryReference.st b/Iceberg-Libgit.package/IceLibgitRepository.class/instance/subdirectoryReference.st new file mode 100644 index 0000000000..0175ff051d --- /dev/null +++ b/Iceberg-Libgit.package/IceLibgitRepository.class/instance/subdirectoryReference.st @@ -0,0 +1,4 @@ +API-accessing +subdirectoryReference + + ^ self location resolve: self subdirectoryPath \ No newline at end of file diff --git a/Iceberg-Tests.package/IceAbstractTestFactory.class/instance/newRepositoryNamed..st b/Iceberg-Tests.package/IceAbstractTestFactory.class/instance/newRepositoryNamed..st index 5db88ec02a..80c4cabe26 100644 --- a/Iceberg-Tests.package/IceAbstractTestFactory.class/instance/newRepositoryNamed..st +++ b/Iceberg-Tests.package/IceAbstractTestFactory.class/instance/newRepositoryNamed..st @@ -1,4 +1,4 @@ initialization newRepositoryNamed: projectName - self subclassResponsibility \ No newline at end of file + ^ self newRepositoryNamed: projectName withSubdirectory: '' \ No newline at end of file diff --git a/Iceberg-Tests.package/IceAbstractTestFactory.class/instance/newRepositoryNamed.withSubdirectory..st b/Iceberg-Tests.package/IceAbstractTestFactory.class/instance/newRepositoryNamed.withSubdirectory..st new file mode 100644 index 0000000000..7045bcddf9 --- /dev/null +++ b/Iceberg-Tests.package/IceAbstractTestFactory.class/instance/newRepositoryNamed.withSubdirectory..st @@ -0,0 +1,4 @@ +initialization +newRepositoryNamed: projectName withSubdirectory: aSubdirectory + + self subclassResponsibility \ No newline at end of file diff --git a/Iceberg-Tests.package/IceBasicRepositoryFixture.class/instance/initialize.st b/Iceberg-Tests.package/IceBasicRepositoryFixture.class/instance/initialize.st new file mode 100644 index 0000000000..54439d4686 --- /dev/null +++ b/Iceberg-Tests.package/IceBasicRepositoryFixture.class/instance/initialize.st @@ -0,0 +1,4 @@ +initialization +initialize + super initialize. + subdirectory := ''. \ No newline at end of file diff --git a/Iceberg-Tests.package/IceBasicRepositoryFixture.class/instance/setUp.st b/Iceberg-Tests.package/IceBasicRepositoryFixture.class/instance/setUp.st index 597d31ede9..c1271b3ed4 100644 --- a/Iceberg-Tests.package/IceBasicRepositoryFixture.class/instance/setUp.st +++ b/Iceberg-Tests.package/IceBasicRepositoryFixture.class/instance/setUp.st @@ -2,4 +2,4 @@ running setUp super setUp. - repository := factory newRepositoryNamed: projectName \ No newline at end of file + repository := factory newRepositoryNamed: projectName withSubdirectory: self subdirectory \ No newline at end of file diff --git a/Iceberg-Tests.package/IceBasicRepositoryFixture.class/instance/subdirectory..st b/Iceberg-Tests.package/IceBasicRepositoryFixture.class/instance/subdirectory..st new file mode 100644 index 0000000000..abb6227db0 --- /dev/null +++ b/Iceberg-Tests.package/IceBasicRepositoryFixture.class/instance/subdirectory..st @@ -0,0 +1,4 @@ +running +subdirectory: aSubdirectory + + subdirectory := aSubdirectory \ No newline at end of file diff --git a/Iceberg-Tests.package/IceBasicRepositoryFixture.class/instance/subdirectory.st b/Iceberg-Tests.package/IceBasicRepositoryFixture.class/instance/subdirectory.st new file mode 100644 index 0000000000..645fd5c9af --- /dev/null +++ b/Iceberg-Tests.package/IceBasicRepositoryFixture.class/instance/subdirectory.st @@ -0,0 +1,4 @@ +running +subdirectory + + ^ subdirectory \ No newline at end of file diff --git a/Iceberg-Tests.package/IceBasicRepositoryFixture.class/properties.json b/Iceberg-Tests.package/IceBasicRepositoryFixture.class/properties.json index 558009618d..1cf950e264 100644 --- a/Iceberg-Tests.package/IceBasicRepositoryFixture.class/properties.json +++ b/Iceberg-Tests.package/IceBasicRepositoryFixture.class/properties.json @@ -6,7 +6,8 @@ "pools" : [ ], "classvars" : [ ], "instvars" : [ - "repository" + "repository", + "subdirectory" ], "name" : "IceBasicRepositoryFixture", "type" : "normal" diff --git a/Iceberg-Tests.package/IceGitTestFactory.class/instance/newRepositoryNamed..st b/Iceberg-Tests.package/IceGitTestFactory.class/instance/newRepositoryNamed.withSubdirectory..st similarity index 87% rename from Iceberg-Tests.package/IceGitTestFactory.class/instance/newRepositoryNamed..st rename to Iceberg-Tests.package/IceGitTestFactory.class/instance/newRepositoryNamed.withSubdirectory..st index df931eb039..9c41275ddd 100644 --- a/Iceberg-Tests.package/IceGitTestFactory.class/instance/newRepositoryNamed..st +++ b/Iceberg-Tests.package/IceGitTestFactory.class/instance/newRepositoryNamed.withSubdirectory..st @@ -1,10 +1,11 @@ initialization -newRepositoryNamed: projectName +newRepositoryNamed: projectName withSubdirectory: aSubdirectory | repository | (self location / projectName) ensureDeleteAll. repository := IceRepositoryCreator new location: self location / projectName; + subdirectory: aSubdirectory; createNewRepositoryNamed: projectName. (OSEnvironment default at: 'CI' ifAbsent: []) = 'true' ifTrue: [ diff --git a/Iceberg-Tests.package/IceInMemoryTestFactory.class/instance/newRepositoryNamed..st b/Iceberg-Tests.package/IceInMemoryTestFactory.class/instance/newRepositoryNamed.withSubdirectory..st similarity index 62% rename from Iceberg-Tests.package/IceInMemoryTestFactory.class/instance/newRepositoryNamed..st rename to Iceberg-Tests.package/IceInMemoryTestFactory.class/instance/newRepositoryNamed.withSubdirectory..st index 2916cc47d9..ac3acef430 100644 --- a/Iceberg-Tests.package/IceInMemoryTestFactory.class/instance/newRepositoryNamed..st +++ b/Iceberg-Tests.package/IceInMemoryTestFactory.class/instance/newRepositoryNamed.withSubdirectory..st @@ -1,6 +1,6 @@ initialization -newRepositoryNamed: projectName - +newRepositoryNamed: projectName withSubdirectory: aSubdirectory + "Ignore the subdirectory in memory" | repository | repository := IceMemoryRepository new. repository workingCopy: (IceRingWorkingCopy fromWorkingCopy: repository workingCopy). diff --git a/Iceberg-Tests.package/IceSinglePackageLocalGitRepositoryWithDotSubdirectoryTest.class/README.md b/Iceberg-Tests.package/IceSinglePackageLocalGitRepositoryWithDotSubdirectoryTest.class/README.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/Iceberg-Tests.package/IceSinglePackageLocalGitRepositoryWithDotSubdirectoryTest.class/instance/newFixture.st b/Iceberg-Tests.package/IceSinglePackageLocalGitRepositoryWithDotSubdirectoryTest.class/instance/newFixture.st new file mode 100644 index 0000000000..3c4332226c --- /dev/null +++ b/Iceberg-Tests.package/IceSinglePackageLocalGitRepositoryWithDotSubdirectoryTest.class/instance/newFixture.st @@ -0,0 +1,6 @@ +running +newFixture + + ^ IceSinglePackageFixture inGit + subdirectory: '.'; + yourself \ No newline at end of file diff --git a/Iceberg-Tests.package/IceSinglePackageLocalGitRepositoryWithDotSubdirectoryTest.class/instance/testCodeSubdirectoryIsRoot.st b/Iceberg-Tests.package/IceSinglePackageLocalGitRepositoryWithDotSubdirectoryTest.class/instance/testCodeSubdirectoryIsRoot.st new file mode 100644 index 0000000000..9872011821 --- /dev/null +++ b/Iceberg-Tests.package/IceSinglePackageLocalGitRepositoryWithDotSubdirectoryTest.class/instance/testCodeSubdirectoryIsRoot.st @@ -0,0 +1,4 @@ +running +testCodeSubdirectoryIsRoot + + self assert: self repository location equals: self repository subdirectoryReference \ No newline at end of file diff --git a/Iceberg-Tests.package/IceSinglePackageLocalGitRepositoryWithDotSubdirectoryTest.class/properties.json b/Iceberg-Tests.package/IceSinglePackageLocalGitRepositoryWithDotSubdirectoryTest.class/properties.json new file mode 100644 index 0000000000..fbbc98f028 --- /dev/null +++ b/Iceberg-Tests.package/IceSinglePackageLocalGitRepositoryWithDotSubdirectoryTest.class/properties.json @@ -0,0 +1,11 @@ +{ + "commentStamp" : "", + "super" : "IceSinglePackageLocalRepositoryTest", + "category" : "Iceberg-Tests-Git", + "classinstvars" : [ ], + "pools" : [ ], + "classvars" : [ ], + "instvars" : [ ], + "name" : "IceSinglePackageLocalGitRepositoryWithDotSubdirectoryTest", + "type" : "normal" +} \ No newline at end of file diff --git a/Iceberg-Tests.package/IceSinglePackageLocalGitRepositoryWithSubdirectoryTest.class/README.md b/Iceberg-Tests.package/IceSinglePackageLocalGitRepositoryWithSubdirectoryTest.class/README.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/Iceberg-Tests.package/IceSinglePackageLocalGitRepositoryWithSubdirectoryTest.class/instance/newFixture.st b/Iceberg-Tests.package/IceSinglePackageLocalGitRepositoryWithSubdirectoryTest.class/instance/newFixture.st new file mode 100644 index 0000000000..59944ef80f --- /dev/null +++ b/Iceberg-Tests.package/IceSinglePackageLocalGitRepositoryWithSubdirectoryTest.class/instance/newFixture.st @@ -0,0 +1,6 @@ +running +newFixture + + ^ IceSinglePackageFixture inGit + subdirectory: 'src'; + yourself \ No newline at end of file diff --git a/Iceberg-Tests.package/IceSinglePackageLocalGitRepositoryWithSubdirectoryTest.class/properties.json b/Iceberg-Tests.package/IceSinglePackageLocalGitRepositoryWithSubdirectoryTest.class/properties.json new file mode 100644 index 0000000000..4fd23bd993 --- /dev/null +++ b/Iceberg-Tests.package/IceSinglePackageLocalGitRepositoryWithSubdirectoryTest.class/properties.json @@ -0,0 +1,11 @@ +{ + "commentStamp" : "", + "super" : "IceSinglePackageLocalRepositoryTest", + "category" : "Iceberg-Tests-Git", + "classinstvars" : [ ], + "pools" : [ ], + "classvars" : [ ], + "instvars" : [ ], + "name" : "IceSinglePackageLocalGitRepositoryWithSubdirectoryTest", + "type" : "normal" +} \ No newline at end of file diff --git a/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testChangeClassSideMakesChangesContainClassDefinition.st b/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testChangeClassSideMakesChangesContainClassDefinition.st index eca0e7013b..2181d15940 100644 --- a/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testChangeClassSideMakesChangesContainClassDefinition.st +++ b/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testChangeClassSideMakesChangesContainClassDefinition.st @@ -15,8 +15,8 @@ testChangeClassSideMakesChangesContainClassDefinition with: [ :class | class metaclass instanceVariables: #(someClassInstVar) ]. diff := self repository workingCopyDiff. - self assert: diff tree children size equals: 1. - self assert: (diff tree / self packageName1) children size equals: 1. - self assert: (diff tree / self packageName1 / 'IceGeneratedClassForTesting class') value isAddition. - self assert: (diff tree / self packageName1 / 'IceGeneratedClassForTesting class') value definition isClassDefinition. - self assert: (diff tree / self packageName1 / 'IceGeneratedClassForTesting class') value definition name equals: #'IceGeneratedClassForTesting class'. \ No newline at end of file + self assert: diff codeSubdirectoryNode children size equals: 1. + self assert: (diff codeSubdirectoryNode / self packageName1) children size equals: 1. + self assert: (diff codeSubdirectoryNode / self packageName1 / 'IceGeneratedClassForTesting class') value isAddition. + self assert: (diff codeSubdirectoryNode / self packageName1 / 'IceGeneratedClassForTesting class') value definition isClassDefinition. + self assert: (diff codeSubdirectoryNode / self packageName1 / 'IceGeneratedClassForTesting class') value definition name equals: #'IceGeneratedClassForTesting class'. \ No newline at end of file diff --git a/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testChangeClassSideMakesIsExportedInCommit.st b/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testChangeClassSideMakesIsExportedInCommit.st index 676e0446f7..cad9ab695f 100644 --- a/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testChangeClassSideMakesIsExportedInCommit.st +++ b/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testChangeClassSideMakesIsExportedInCommit.st @@ -18,7 +18,7 @@ testChangeClassSideMakesIsExportedInCommit diff := self repository headCommit diffToParent. self assert: diff tree children size equals: 1. - self assert: (diff tree / self packageName1) children size equals: 1. - self assert: (diff tree / self packageName1 / 'IceGeneratedClassForTesting class') value isAddition. - self assert: (diff tree / self packageName1 / 'IceGeneratedClassForTesting class') value definition isClassDefinition. - self assert: (diff tree / self packageName1 / 'IceGeneratedClassForTesting class') value definition name equals: #'IceGeneratedClassForTesting class'. \ No newline at end of file + self assert: (diff codeSubdirectoryNode / self packageName1) children size equals: 1. + self assert: (diff codeSubdirectoryNode / self packageName1 / 'IceGeneratedClassForTesting class') value isAddition. + self assert: (diff codeSubdirectoryNode / self packageName1 / 'IceGeneratedClassForTesting class') value definition isClassDefinition. + self assert: (diff codeSubdirectoryNode / self packageName1 / 'IceGeneratedClassForTesting class') value definition name equals: #'IceGeneratedClassForTesting class'. \ No newline at end of file diff --git a/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testChangeClassSideMakesIsExportedInCommitSecondVariable.st b/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testChangeClassSideMakesIsExportedInCommitSecondVariable.st index 7990734edc..b8391eece6 100644 --- a/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testChangeClassSideMakesIsExportedInCommitSecondVariable.st +++ b/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testChangeClassSideMakesIsExportedInCommitSecondVariable.st @@ -24,8 +24,8 @@ testChangeClassSideMakesIsExportedInCommitSecondVariable self repository commitWithMessage: 'Added another class instance variable'. diff := self repository headCommit diffToParent. - self assert: diff tree children size equals: 1. - self assert: (diff tree / self packageName1) children size equals: 1. - self assert: (diff tree / self packageName1 / 'IceGeneratedClassForTesting class') value isModification. - self assert: (diff tree / self packageName1 / 'IceGeneratedClassForTesting class') value definition isClassDefinition. - self assert: (diff tree / self packageName1 / 'IceGeneratedClassForTesting class') value definition name equals: #'IceGeneratedClassForTesting class'. \ No newline at end of file + self assert: diff codeSubdirectoryNode children size equals: 1. + self assert: (diff codeSubdirectoryNode / self packageName1) children size equals: 1. + self assert: (diff codeSubdirectoryNode / self packageName1 / 'IceGeneratedClassForTesting class') value isModification. + self assert: (diff codeSubdirectoryNode / self packageName1 / 'IceGeneratedClassForTesting class') value definition isClassDefinition. + self assert: (diff codeSubdirectoryNode / self packageName1 / 'IceGeneratedClassForTesting class') value definition name equals: #'IceGeneratedClassForTesting class'. \ No newline at end of file diff --git a/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testChangeClassWithTraitsSideMakesIsExportedInCommit.st b/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testChangeClassWithTraitsSideMakesIsExportedInCommit.st index 333814cf68..2c2c681f83 100644 --- a/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testChangeClassWithTraitsSideMakesIsExportedInCommit.st +++ b/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testChangeClassWithTraitsSideMakesIsExportedInCommit.st @@ -26,8 +26,8 @@ testChangeClassWithTraitsSideMakesIsExportedInCommit self repository commitWithMessage: 'Added class instance variable'. diff := self repository headCommit diffToParent. - self assert: diff tree children size equals: 1. - self assert: (diff tree / self packageName1) children size equals: 1. - self assert: (diff tree / self packageName1 / 'IceGeneratedClassForTesting class') value isAddition. - self assert: (diff tree / self packageName1 / 'IceGeneratedClassForTesting class') value definition isClassDefinition. - self assert: (diff tree / self packageName1 / 'IceGeneratedClassForTesting class') value definition name equals: #'IceGeneratedClassForTesting class'. \ No newline at end of file + self assert: diff codeSubdirectoryNode children size equals: 1. + self assert: (diff codeSubdirectoryNode / self packageName1) children size equals: 1. + self assert: (diff codeSubdirectoryNode / self packageName1 / 'IceGeneratedClassForTesting class') value isAddition. + self assert: (diff codeSubdirectoryNode / self packageName1 / 'IceGeneratedClassForTesting class') value definition isClassDefinition. + self assert: (diff codeSubdirectoryNode / self packageName1 / 'IceGeneratedClassForTesting class') value definition name equals: #'IceGeneratedClassForTesting class'. \ No newline at end of file diff --git a/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testChangeClassWithTraitsSideMakesIsExportedInCommitSecondVariable.st b/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testChangeClassWithTraitsSideMakesIsExportedInCommitSecondVariable.st index ac6adedb4c..dc5f051cfc 100644 --- a/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testChangeClassWithTraitsSideMakesIsExportedInCommitSecondVariable.st +++ b/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testChangeClassWithTraitsSideMakesIsExportedInCommitSecondVariable.st @@ -33,8 +33,8 @@ testChangeClassWithTraitsSideMakesIsExportedInCommitSecondVariable self repository commitWithMessage: 'Added another class instance variable'. diff := self repository headCommit diffToParent. - self assert: diff tree children size equals: 1. - self assert: (diff tree / self packageName1) children size equals: 1. - self assert: (diff tree / self packageName1 / 'IceGeneratedClassForTesting class') value isModification. - self assert: (diff tree / self packageName1 / 'IceGeneratedClassForTesting class') value definition isClassDefinition. - self assert: (diff tree / self packageName1 / 'IceGeneratedClassForTesting class') value definition name equals: #'IceGeneratedClassForTesting class'. \ No newline at end of file + self assert: diff codeSubdirectoryNode children size equals: 1. + self assert: (diff codeSubdirectoryNode / self packageName1) children size equals: 1. + self assert: (diff codeSubdirectoryNode / self packageName1 / 'IceGeneratedClassForTesting class') value isModification. + self assert: (diff codeSubdirectoryNode / self packageName1 / 'IceGeneratedClassForTesting class') value definition isClassDefinition. + self assert: (diff codeSubdirectoryNode / self packageName1 / 'IceGeneratedClassForTesting class') value definition name equals: #'IceGeneratedClassForTesting class'. \ No newline at end of file diff --git a/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testCreateClassInImageMakesChangesContainClassDefinition.st b/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testCreateClassInImageMakesChangesContainClassDefinition.st index 8f980813bb..26ee1f6439 100644 --- a/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testCreateClassInImageMakesChangesContainClassDefinition.st +++ b/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testCreateClassInImageMakesChangesContainClassDefinition.st @@ -8,8 +8,8 @@ testCreateClassInImageMakesChangesContainClassDefinition inPackage: self packageName1 asSymbol. diff := self repository workingCopyDiff. - self assert: diff tree children size equals: 1. - self assert: (diff tree / self packageName1) children size equals: 1. - self assert: (diff tree / self packageName1 / 'IceGeneratedClassForTesting') value isAddition. - self assert: (diff tree / self packageName1 / 'IceGeneratedClassForTesting') value definition isClassDefinition. - self assert: (diff tree / self packageName1 / 'IceGeneratedClassForTesting') value definition name equals: #IceGeneratedClassForTesting. \ No newline at end of file + self assert: diff codeSubdirectoryNode children size equals: 1. + self assert: (diff codeSubdirectoryNode / self packageName1) children size equals: 1. + self assert: (diff codeSubdirectoryNode / self packageName1 / 'IceGeneratedClassForTesting') value isAddition. + self assert: (diff codeSubdirectoryNode / self packageName1 / 'IceGeneratedClassForTesting') value definition isClassDefinition. + self assert: (diff codeSubdirectoryNode / self packageName1 / 'IceGeneratedClassForTesting') value definition name equals: #IceGeneratedClassForTesting. \ No newline at end of file diff --git a/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testCreateExtensionMethodMakesExtensionMethodAsAddition.st b/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testCreateExtensionMethodMakesExtensionMethodAsAddition.st index f34c5ec443..aad9f7c198 100644 --- a/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testCreateExtensionMethodMakesExtensionMethodAsAddition.st +++ b/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testCreateExtensionMethodMakesExtensionMethodAsAddition.st @@ -10,9 +10,9 @@ testCreateExtensionMethodMakesExtensionMethodAsAddition inPackage: self packageName1 asSymbol. diff := self repository workingCopyDiff. - self assert: diff tree children size equals: 1. - self assert: (diff tree / self packageName1) children size equals: 1. - self assert: (diff tree / self packageName1 / 'ToBeExtended') value isAddition. - self assert: (diff tree / self packageName1 / 'ToBeExtended') value definition isExtensionDefinition. - self assert: (diff tree / self packageName1 / 'ToBeExtended' / 'method') value isAddition. - self assert: (diff tree / self packageName1 / 'ToBeExtended' / 'method') value definition isMethodDefinition. \ No newline at end of file + self assert: diff codeSubdirectoryNode children size equals: 1. + self assert: (diff codeSubdirectoryNode / self packageName1) children size equals: 1. + self assert: (diff codeSubdirectoryNode / self packageName1 / 'ToBeExtended') value isAddition. + self assert: (diff codeSubdirectoryNode / self packageName1 / 'ToBeExtended') value definition isExtensionDefinition. + self assert: (diff codeSubdirectoryNode / self packageName1 / 'ToBeExtended' / 'method') value isAddition. + self assert: (diff codeSubdirectoryNode / self packageName1 / 'ToBeExtended' / 'method') value definition isMethodDefinition. \ No newline at end of file diff --git a/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testRemoveExtensionMethodMakesExtensionRemoval.st b/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testRemoveExtensionMethodMakesExtensionRemoval.st index dd1ef18851..6446d474e5 100644 --- a/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testRemoveExtensionMethodMakesExtensionRemoval.st +++ b/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testRemoveExtensionMethodMakesExtensionRemoval.st @@ -18,9 +18,9 @@ testRemoveExtensionMethodMakesExtensionRemoval fromPackage: self packageName1 asSymbol. diff := self repository workingCopyDiff. - self assert: diff tree children size equals: 1. - self assert: (diff tree / self packageName1) children size equals: 1. - self assert: (diff tree / self packageName1 / 'ToBeExtended') value isRemoval. - self assert: (diff tree / self packageName1 / 'ToBeExtended') value definition isExtensionDefinition. - self assert: (diff tree / self packageName1 / 'ToBeExtended' / 'method') value isRemoval. - self assert: (diff tree / self packageName1 / 'ToBeExtended' / 'method') value definition isMethodDefinition. \ No newline at end of file + self assert: diff codeSubdirectoryNode children size equals: 1. + self assert: (diff codeSubdirectoryNode / self packageName1) children size equals: 1. + self assert: (diff codeSubdirectoryNode / self packageName1 / 'ToBeExtended') value isRemoval. + self assert: (diff codeSubdirectoryNode / self packageName1 / 'ToBeExtended') value definition isExtensionDefinition. + self assert: (diff codeSubdirectoryNode / self packageName1 / 'ToBeExtended' / 'method') value isRemoval. + self assert: (diff codeSubdirectoryNode / self packageName1 / 'ToBeExtended' / 'method') value definition isMethodDefinition. \ No newline at end of file diff --git a/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testRemovePackageRemovesIt.st b/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testRemovePackageRemovesIt.st index f612621dc9..5344cfa6cc 100644 --- a/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testRemovePackageRemovesIt.st +++ b/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testRemovePackageRemovesIt.st @@ -5,4 +5,4 @@ testRemovePackageRemovesIt package := self repository workingCopy packageNamed: self packageName1. package remove. - self assert: (self repository workingCopyDiff tree / self packageName1) value isRemoval \ No newline at end of file + self assert: (self repository workingCopyDiff codeSubdirectoryNode / self packageName1) value isRemoval \ No newline at end of file diff --git a/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testRevertSingleDefinitionRevertsClassAddition.st b/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testRevertSingleDefinitionRevertsClassAddition.st index 442f3dffe2..2e6f34e935 100644 --- a/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testRevertSingleDefinitionRevertsClassAddition.st +++ b/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testRevertSingleDefinitionRevertsClassAddition.st @@ -10,5 +10,5 @@ testRevertSingleDefinitionRevertsClassAddition inPackage: self packageName1 asSymbol. self assertClassExists: className. - self workingCopy discardChanges: (self repository workingCopyDiff tree / self packageName1 / className). + self workingCopy discardChanges: (self repository workingCopyDiff codeSubdirectoryNode / self packageName1 / className). self denyClassExists: className. \ No newline at end of file diff --git a/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testRevertSingleDefinitionRevertsClassRemoval.st b/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testRevertSingleDefinitionRevertsClassRemoval.st index cd4af4fcc6..43d9944dc6 100644 --- a/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testRevertSingleDefinitionRevertsClassRemoval.st +++ b/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testRevertSingleDefinitionRevertsClassRemoval.st @@ -15,5 +15,5 @@ testRevertSingleDefinitionRevertsClassRemoval removeClassNamed: className. self denyClassExists: className. - self workingCopy discardChanges: (self repository workingCopyDiff tree / self packageName1 / className). + self workingCopy discardChanges: (self repository workingCopyDiff codeSubdirectoryNode / self packageName1 / className). self assertClassExists: className. \ No newline at end of file diff --git a/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testRevertSingleDefinitionRevertsClassSlotModification.st b/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testRevertSingleDefinitionRevertsClassSlotModification.st index 613d760ed0..db75bf7c6f 100644 --- a/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testRevertSingleDefinitionRevertsClassSlotModification.st +++ b/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testRevertSingleDefinitionRevertsClassSlotModification.st @@ -19,6 +19,6 @@ testRevertSingleDefinitionRevertsClassSlotModification self assert: ((self repository workingCopy environment ask behaviorNamed: className) instVarNames includes: #slot). - self workingCopy discardChanges: (self repository workingCopyDiff tree / self packageName1 / className). + self workingCopy discardChanges: (self repository workingCopyDiff codeSubdirectoryNode / self packageName1 / className). self deny: ((self repository workingCopy environment ask behaviorNamed: className) instVarNames includes: #slot). \ No newline at end of file diff --git a/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testRevertSingleDefinitionRevertsMethodAddition.st b/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testRevertSingleDefinitionRevertsMethodAddition.st index dcc329b959..db6a557896 100644 --- a/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testRevertSingleDefinitionRevertsMethodAddition.st +++ b/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testRevertSingleDefinitionRevertsMethodAddition.st @@ -15,5 +15,5 @@ testRevertSingleDefinitionRevertsMethodAddition createMethod: 'method' inClass: className. self assertMethodExists: 'method' inClass: className. - self workingCopy discardChanges: (self repository workingCopyDiff tree / self packageName1 / className / 'method'). + self workingCopy discardChanges: (self repository workingCopyDiff codeSubdirectoryNode / self packageName1 / className / 'method'). self denyMethodExists: 'method' inClass: className. \ No newline at end of file diff --git a/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testRevertSingleDefinitionRevertsMethodModification.st b/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testRevertSingleDefinitionRevertsMethodModification.st index 383529125c..64901f2f67 100644 --- a/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testRevertSingleDefinitionRevertsMethodModification.st +++ b/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testRevertSingleDefinitionRevertsMethodModification.st @@ -21,7 +21,7 @@ testRevertSingleDefinitionRevertsMethodModification self assert: ((self repository workingCopy environment ask behaviorNamed: className) methodNamed: 'method') sourceCode equals: 'method ^ 42'. - self workingCopy discardChanges: (self repository workingCopyDiff tree / self packageName1 / className / 'method'). + self workingCopy discardChanges: (self repository workingCopyDiff codeSubdirectoryNode / self packageName1 / className / 'method'). self assertMethodExists: 'method' inClass: className. self assert: ((self repository workingCopy environment ask behaviorNamed: className) methodNamed: 'method') sourceCode diff --git a/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testRevertSingleDefinitionRevertsMethodRemoval.st b/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testRevertSingleDefinitionRevertsMethodRemoval.st index d4e03be286..820bf3f8a8 100644 --- a/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testRevertSingleDefinitionRevertsMethodRemoval.st +++ b/Iceberg-Tests.package/IceSinglePackageLocalRepositoryTest.class/instance/testRevertSingleDefinitionRevertsMethodRemoval.st @@ -18,5 +18,5 @@ testRevertSingleDefinitionRevertsMethodRemoval removeMethod: 'method' fromClass: className. self denyMethodExists: 'method' inClass: className. - self workingCopy discardChanges: (self repository workingCopyDiff tree / self packageName1 / className / 'method'). + self workingCopy discardChanges: (self repository workingCopyDiff codeSubdirectoryNode / self packageName1 / className / 'method'). self assertMethodExists: 'method' inClass: className. \ No newline at end of file diff --git a/Iceberg.package/IceChangeImporter.class/instance/ensureSourceCodeDirectoryIn..st b/Iceberg.package/IceChangeImporter.class/instance/ensureSourceCodeDirectoryIn..st index 6fa444109e..5f25d72267 100644 --- a/Iceberg.package/IceChangeImporter.class/instance/ensureSourceCodeDirectoryIn..st +++ b/Iceberg.package/IceChangeImporter.class/instance/ensureSourceCodeDirectoryIn..st @@ -1,9 +1,9 @@ private ensureSourceCodeDirectoryIn: aNode | codeSubdirectoryName | - codeSubdirectoryName := diff repository subdirectory. - codeSubdirectoryName ifEmpty: [ ^ aNode ]. + (codeSubdirectoryName isEmpty or: [ codeSubdirectoryName = '.' ]) + ifTrue: [ ^ aNode ]. aNode childAt: codeSubdirectoryName ifPresent: [ :node | self assert: node value isDirectoryDefinition. diff --git a/Iceberg.package/IceDiff.class/instance/isCodeSubdirectory..st b/Iceberg.package/IceDiff.class/instance/isCodeSubdirectory..st index 1961f7cc70..6caa25a0cc 100644 --- a/Iceberg.package/IceDiff.class/instance/isCodeSubdirectory..st +++ b/Iceberg.package/IceDiff.class/instance/isCodeSubdirectory..st @@ -3,5 +3,5 @@ isCodeSubdirectory: aNode | nodeLocation repositorySubdirectoryLocation | nodeLocation := self repository location resolve: aNode path. - repositorySubdirectoryLocation := self repository location resolve: (Path from: self repository subdirectory). + repositorySubdirectoryLocation := self repository subdirectoryReference. ^ nodeLocation = repositorySubdirectoryLocation \ No newline at end of file diff --git a/Iceberg.package/IceEmptyNode.class/instance/firstNodeSuchThat..st b/Iceberg.package/IceEmptyNode.class/instance/firstNodeSuchThat..st new file mode 100644 index 0000000000..44d5cd5b66 --- /dev/null +++ b/Iceberg.package/IceEmptyNode.class/instance/firstNodeSuchThat..st @@ -0,0 +1,4 @@ +enumerating +firstNodeSuchThat: conditionBlock + + ^ self firstNodeSuchThat: conditionBlock ifNone: [ NotFound signalFor: conditionBlock ] \ No newline at end of file diff --git a/Iceberg.package/IceEmptyNode.class/instance/firstNodeSuchThat.ifNone..st b/Iceberg.package/IceEmptyNode.class/instance/firstNodeSuchThat.ifNone..st new file mode 100644 index 0000000000..f1301a467e --- /dev/null +++ b/Iceberg.package/IceEmptyNode.class/instance/firstNodeSuchThat.ifNone..st @@ -0,0 +1,7 @@ +enumerating +firstNodeSuchThat: conditionBlock ifNone: noneBlock + + (conditionBlock value: self) + ifTrue: [ ^ self ]. + + ^ noneBlock value \ No newline at end of file diff --git a/Iceberg.package/IceEmptyNode.class/instance/path.st b/Iceberg.package/IceEmptyNode.class/instance/path.st new file mode 100644 index 0000000000..375d7ba664 --- /dev/null +++ b/Iceberg.package/IceEmptyNode.class/instance/path.st @@ -0,0 +1,4 @@ +accessing +path + + ^ RelativePath new \ No newline at end of file diff --git a/Iceberg.package/IceUnbornProject.class/instance/packagesFrom..st b/Iceberg.package/IceUnbornProject.class/instance/packagesFrom..st deleted file mode 100644 index d414987179..0000000000 --- a/Iceberg.package/IceUnbornProject.class/instance/packagesFrom..st +++ /dev/null @@ -1,5 +0,0 @@ -API-packages -packagesFrom: aCommit - - "An unborn project has no packages" - ^ #() \ No newline at end of file