# HG changeset patch # User Jan Vrany # Date 1625809629 -3600 # Node ID c4a1d37b80f38d89fc76629edfa2fca5a71c6668 # Parent 2c1315a145fd54e398ac244cd8438afc9820d811 Fix (bad) source corruption when committing private classes This commit fixes a really bad bug causing source corruption when committing private classes *and* when using original repository for commits ( `hgUseOriginalRepositories: true`). This was becase private classes's source was not made local prior opening the enclosing class's container for writing! Sigh. diff -r 2c1315a145fd -r c4a1d37b80f3 common/SCMAbstractPackageWorkingCopy.st --- a/common/SCMAbstractPackageWorkingCopy.st Fri Feb 19 12:14:01 2021 +0100 +++ b/common/SCMAbstractPackageWorkingCopy.st Fri Jul 09 06:47:09 2021 +0100 @@ -416,28 +416,21 @@ !SCMAbstractPackageWorkingCopy methodsFor:'file out'! -fileOutClass:cls - - |stream| - - cls theNonMetaclass methodDictionary do: - [:each|each makeLocalStringSource]. +fileOutClass: cls + | stream | - cls theMetaclass methodDictionary do: - [:each|each makeLocalStringSource]. - - stream := self containerWriteStreamForClass:cls. + self makeLocalStringSource: cls. + stream := self containerWriteStreamForClass: cls. [ - self fileOutClass:cls on:stream - ] ensure:[ - stream close - ] + self fileOutClass: cls on: stream + ] ensure: [ stream close ] "Modified: / 11-06-2009 / 16:18:19 / Jan Vrany " "Created: / 30-12-2009 / 19:04:25 / Jan Vrany " "Modified: / 03-07-2013 / 19:50:08 / Jan Vrany " "Modified (format): / 30-07-2014 / 20:49:35 / Jan Vrany " "Modified: / 26-10-2020 / 23:51:41 / Jan Vrany " + "Modified (format): / 04-07-2021 / 21:48:46 / Jan Vrany " ! fileOutClass:cls on:clsStream @@ -745,6 +738,23 @@ "Modified (comment): / 05-03-2014 / 23:21:09 / Jan Vrany " ! +makeLocalStringSource: cls + "Make sure all methods in given class (and its private classes) + have 'local' source (that is, the source is in smalltalk memory + as opposed to in a file on a disk) + " + + cls theNonMetaclass methodDictionary do: [:each | + each makeLocalStringSource + ]. + cls theMetaclass methodDictionary do: [:each | + each makeLocalStringSource + ]. + cls privateClassesDo: [ :each | self makeLocalStringSource: each ] + + "Modified: / 09-07-2021 / 06:48:53 / Jan Vrany " +! + updateCachedValues "Update all cached data"