Metacello / metacello

Metacello is a package management system for Smalltalk
MIT License
87 stars 43 forks source link

unlock of a project whose repository does not exist results in error #377

Closed dalehenrich closed 9 years ago

dalehenrich commented 9 years ago

One failure mode is that with a filetree repo, the createRepository fails with a dir does not exist error --- which is fair, except that we are simply trying to set the repository version string, which just does not seem fair ... It seems that in the method MetacelloProjectRegistry>>registerProjectRegistration:, we could skip the setVersionString on error like so:

[
  | repoVersionString |
  repoVersionString :=  spec repositoryVersionString.
  aMetacelloProjectRegistration versionInfo setVersionString: repoVersionString ] on: Error do: [:ignored | ].
dalehenrich commented 9 years ago

on second thought MetacelloMCBaselineOfProjectSpec>>repositoryVersionString is a better place for the error handler ... just return an empty string on Error:

repositoryVersionString
  "extract a version string from the repository ... if possible"

  "must parallel implementation of MetacelloMCBaselineProject>>setBaselineRepositoryDescription: we want the same repoSpec"

  | spec repo |
  self repositorySpecs do: [ :repoSpec | spec := repoSpec ].
  [ repo := spec createRepository ]
    on: Error
    do: [ :ex | ^ '' ].
  ^ repo repositoryVersionString
``