pharo-vcs / iceberg

Iceberg is the main toolset for handling VCS in Pharo.
MIT License
133 stars 84 forks source link

Bug in Tonel conversion plugin #868

Closed jecisc closed 6 years ago

jecisc commented 6 years ago

In Iceberg 1.1.1 I tried to convert a project from FileTree to Tonel and I got this error:

Error: Class category name 'Glamour-Morphic-Widgets' for the class 'GLMActionAnnouncement' is inconsistent with the package name 'Glamour-Morphic-Widgets-rootFiltering'

Here is the stack:

IceLibgitFiletreeReader(Object)>>error:
IceLibgitFiletreeReader(MCFileTreeStCypressReader)>>validateClassCategory:for:
IceLibgitFiletreeReader(MCFileTreeStCypressReader)>>addClassDefinitionFrom:comment:
IceLibgitFiletreeReader(MCFileTreeStCypressReader)>>addClassAndMethodDefinitionsFromEntry:
[ :entry | 
(entry name endsWith: '.trait')
    ifTrue: [ self addTraitAndMethodDefinitionsFromEntry: entry ].
(entry name endsWith: '.class')
    ifTrue: [ self addClassAndMethodDefinitionsFromEntry: entry ].
(entry name endsWith: '.extension')
    ifTrue: [ self addExtensionClassAndMethodDefinitionsFromEntry: entry ] ] in IceLibgitFiletreeReader(MCFileTreeStCypressReader)>>addClassAndMethodDefinitionsFromDirectory: in Block: [ :entry | ...
Array(SequenceableCollection)>>do:
IceLibgitFiletreeReader(MCFileTreeStCypressReader)>>addClassAndMethodDefinitionsFromDirectory:
IceLibgitFiletreeReader(MCFileTreeStCypressReader)>>loadDefinitions
IceLibgitFiletreeReader(MCVersionReader)>>definitions
IceLibgitFiletreeReader(MCVersionReader)>>snapshot
IceLibgitFiletreeReader(MCFileTreeStCypressReader)>>basicVersion
IceLibgitFiletreeReader(MCVersionReader)>>version
[ | commit |
commit := iceVersion commit libgitCommit.
^ (iceVersion commit readerClass on: commit iceVersion: iceVersion)
    version ] in IceLibgitRepository>>mcVersionFor: in Block: [ | commit |...
BlockClosure>>on:do:
IceLibgitRepository>>mcVersionFor:
IceGitCommit(IceCommitish)>>mcVersionFor:
IceSavedPackageVersion>>mcVersion
IceSavedPackageVersion>>mcSnapshot
IceSavedPackageVersion>>snapshot
TonelWriter>>writeVersion:
TonelWriter class>>fileOut:on:
IceConvertFormatAction>>migratePackage:commit:
[ :each | self migratePackage: each commit: commit ] in IceConvertFormatAction>>migrateSources in Block: [ :each | self migratePackage: each commit: commit...etc...
Array(SequenceableCollection)>>do:
IceConvertFormatAction>>migrateSources
IceConvertFormatAction>>execute
IceTipFiletreeToTonelDialog>>doAccept
[ self doAccept ] in IceTipFiletreeToTonelDialog>>accept in Block: [ self doAccept ]
[ :bar | 
bar label: aString.
aBlock value ] in MorphicUIManager(UIManager)>>informUser:during: in Block: [ :bar | ...
[ :bar | aBlock value: bar ] in MorphicUIManager>>informUserDuring: in Block: [ :bar | aBlock value: bar ]
jecisc commented 6 years ago

I think it's a tricky case.

Someone committed a class from Pharo in another package with a different name. ('Glamour-Morphic-Widgets-rootFiltering')

It seems that it's breaking the conversion.

For now I'll just remove this package since it's not used anymore.

guillep commented 6 years ago

I've seen this before but I don't remember where/how it happened. Can you explain a bit better the setup so we can build a test? Or, if you want to build a test...

In any case, this looks like a normal tonel bug, not necessarily a bug with Iceberg, what do you say?

guillep commented 6 years ago

@jecisc I'm fixing several cases about the migration plugin. Could you give me a more detailed description about how to reproduce it? Otherwise I'd prefer to close this one until we have one.

guillep commented 6 years ago

Ok, I'll close it for now.