Hi,
I need to repair a few hundred Etoys (3.1) project files that have spurious changesets in them. How can I do this in Squeak unattended? i.e. without having to load and enter each project, run cleanups and then save them manually?
for each project blah in a defaultDirectory. ProjectLoading loadFromDir: ....... In this project. run commands storeOnServerWithNoInteraction delete project.
TIA .. Subbu
At Wed, 17 Jun 2009 20:35:57 +0530, K. K. Subramaniam wrote:
Hi,
I need to repair a few hundred Etoys (3.1) project files that have spurious changesets in them. How can I do this in Squeak unattended? i.e. without having to load and enter each project, run cleanups and then save them manually?
for each project blah in a defaultDirectory. ProjectLoading loadFromDir: ....... In this project. run commands storeOnServerWithNoInteraction delete project.
I think you got the basics right. I think that QuickGuideMorph class>>convertProjectsWithBooksToSISSIn:to: does somewhat similar. ChangeSet>>clear clears it up, and instead of saving to something else, it have to be saved as a project. The last part may be a bit tricky.
-- Yoshiki
On Friday 19 June 2009 03:44:07 am Yoshiki Ohshima wrote:
for each project blah in a defaultDirectory.
ProjectLoading loadFromDir: ....... In this project. run commands storeOnServerWithNoInteraction delete project.
I think you got the basics right. I think that QuickGuideMorph class>>convertProjectsWithBooksToSISSIn:to: does somewhat similar. ChangeSet>>clear clears it up, and instead of saving to something else, it have to be saved as a project. The last part may be a bit tricky.
Thanks Yoshiki. I did look into your armLengthCommand and QuickGuideMorph methods. Very neat. QCG only reads project files. I got so far: | dir p | dir := FileDirectory default dir fileNamesMatching: '*.pr' do: [ :f | p = ProjectLoading loadName: f stream: (dir readOnlyFileNamed: f) fromDirectory: dir withProjectView: nil. "In project p, do" create new changeset and make it current. ReleaseBuilder new cleanUpChanges. p okToChangeSilently; storeOnServerWithNoInteraction. p delete.
The part I am stuck is in "in project p, do". How can I send messages in a project context without entering it? I need the reverse of armsLengthCommand. Instead of running commands post exit, I need to run commands on entry.
Subbu
At Fri, 19 Jun 2009 05:38:44 +0530, K. K. Subramaniam wrote:
On Friday 19 June 2009 03:44:07 am Yoshiki Ohshima wrote:
for each project blah in a defaultDirectory.
ProjectLoading loadFromDir: ....... In this project. run commands storeOnServerWithNoInteraction delete project.
I think you got the basics right. I think that QuickGuideMorph class>>convertProjectsWithBooksToSISSIn:to: does somewhat similar. ChangeSet>>clear clears it up, and instead of saving to something else, it have to be saved as a project. The last part may be a bit tricky.
Thanks Yoshiki. I did look into your armLengthCommand and QuickGuideMorph methods. Very neat. QCG only reads project files. I got so far: | dir p | dir := FileDirectory default dir fileNamesMatching: '*.pr' do: [ :f | p = ProjectLoading loadName: f stream: (dir readOnlyFileNamed: f) fromDirectory: dir withProjectView: nil. "In project p, do" create new changeset and make it current. ReleaseBuilder new cleanUpChanges. p okToChangeSilently; storeOnServerWithNoInteraction. p delete.
The part I am stuck is in "in project p, do". How can I send messages in a project context without entering it? I need the reverse of armsLengthCommand. Instead of running commands post exit, I need to run commands on entry.
This may be a bit different approach you are taking, but try attached change set. File it into a project (let us call it the root project), and evaluate:
Smalltalk at: #RootProjectName put: Project current name
and then load any project. It clears the changeset of it, and save and comes back to the root project.
Upon entering the root project, a new UI process is started so you cannot be in a loop to iterate over files. You need to add similar technique in the finalEnterActions to iterate over the files.
-- Yoshiki
etoys-dev@lists.squeakfoundation.org