On 3/25/15 1:35 AM, Jan B. wrote:
Hello

I was able to get by those warnings automatically by adding onLock: [ :ex |
ex disallow ]; in addition to onConflict

Metacello new
baseline: '...'
repository: 'gitfiletree:///.../repository'
onConflict: [ :ex | ex allow ];
onLock: [ :ex | ex disallow ];
load

I'm not sure whether it couldn't cause any problems, but it seems to be
working.


I'd recommend that you not put in the unconditional onConflict: ... at one point in time the onConflict: was required to handle locks, but currently the default handler for onConflict: will honor locks and the default handler for onLock: will dump signal a Warning and then honor the lock.

Putting in onLock: as you've done _is_ a good way to bypass the onLock: Warnings ... you can use `honor` instead of `disallow` and `break` instead of `allow` for the onLock: notification as those messages read a bit better ...

The interesting onConflict: notifications occur when an incoming project decides to change the version or repository or configuration type (BaselineOf or ConfigurationOf) ... so if you care to know when this type of thing happens, then you can _leave off the onConflict:_ and you'll get a chance to decide if you want to have that change made to your system, before it is loaded rather than discover the change after it is loaded ... this is basically why I added the onLock: message - so that you weren't tempted to add an uncoditional onConflict: block just because you were working with locks:)

Dale

Reply via email to