pharo-vcs / tonel

MIT License
32 stars 26 forks source link

TonelWriter>>writeSnapshot: includes tag name in package name when there's no OrganizationDefinition #84

Closed carolahp closed 1 year ago

carolahp commented 4 years ago

When writing a snapshot of a package that includes tags and the snapshot does not contain an OrganizationDefinition, the name of the folder for the package includes the name of the tag.

| aSnapshot memoryFileReference writer |
" Taking a snapshot of the package MonticelloMocks "
aSnapshot := (MCPackage new name: #MonticelloMocks) snapshot.
" Removing all elements from the snapshot except one class 
which is classified in the Package's tag 'Tag' "
(aSnapshot definitions
    select: [ :def | def className ~= #MCMockClassJ ])
    do: [ :each | aSnapshot definitions remove: each ].
memoryFileReference := FileSystem memory root.
writer := TonelWriter on: memoryFileReference.
writer writeSnapshot: aSnapshot.

(memoryFileReference / 'MonticelloMocks-Tag') exists. "Should not exist"
(memoryFileReference / 'MonticelloMocks') exists. "Should exist"
jecisc commented 1 year ago

Fixed! :)