TestModel := nil recoverable?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

TestModel := nil recoverable?

Jochen Riekhof
another newbie question:
I accidentally typed
    TestModel := nil.
instead of
    testValue := nil.
in a workspace. It did without warning but afterwards the global class ref
was destroyed. Can I recover this somehow?

Ciao

...Jochen


Reply | Threaded
Open this post in threaded view
|

Re: TestModel := nil recoverable?

Ian Bartholomew-17
Jochen,

> in a workspace. It did without warning but afterwards the global class ref
> was destroyed. Can I recover this somehow?

It's all in the changes file (*.chg) sitting in the folder where your
Dolphin image file resides.  You can either open it up in a normal workspace
[1] then locate and extract the relevant bits or use a tool like my
ChunkBrowser goodie that helps to automate the process.

There are other SCC tools available that make it easier to recover from such
situations that you might want to investigate later.

Regards
    Ian

[1] Don't (in capital letters) modify the changes file and then resave it -
that will cause more problems.


Reply | Threaded
Open this post in threaded view
|

Re: TestModel := nil recoverable?

Jochen Riekhof-3
> It's all in the changes file (*.chg) sitting in the folder where your
> Dolphin image file resides.  You can either open it up in a normal
workspace
> [1] then locate and extract the relevant bits or use a tool like my
> ChunkBrowser goodie that helps to automate the process.
> [1] Don't (in capital letters) modify the changes file and then resave
it -
> that will cause more problems.

Sounds like what I've done is savest practise, discarding the image and
reloading dolphin ;-).
I did not dare to save my package first (the one containing the class set to
nil). Do you know if I could have done this safely in this case or would the
package be damaged afterwards?

Ciao

...Jochen


Reply | Threaded
Open this post in threaded view
|

Re: TestModel := nil recoverable?

Ian Bartholomew-17
Jochen,

> Sounds like what I've done is savest practise, discarding the image and
> reloading dolphin ;-).

I assumed from your original post that you hadn't saved the class in a
package before you set the global to nil?  As you had a package then
starting again and reloading the package would be best.  The ony time you
need to delve into the changes file is when you have made changes that
haven't been saved in any other format.

> I did not dare to save my package first (the one containing the class set
to
> nil). Do you know if I could have done this safely in this case or would
the
> package be damaged afterwards?

Saving the package would overwrite any existing package file so, as you had
deleted the class, you would have ended up with a package file that didn't
contain the class.  It's just the same as deleting a section of a text file
and then saving it over the original.

If you had saved the package without the class then the best way to proceed
would probably have been to restart Dolphin, recover the missing class from
the change file, file in the package, add the class back into the package
and then resave it.

It's quite difficult (although obviously not impossible) to accidentally
lose source code in Smalltalk.  The difficulty can be in finding the bits
you want and putting them back together - it gets easier with practice
though :-).

Regards
    Ian


Reply | Threaded
Open this post in threaded view
|

Re: TestModel := nil recoverable?

Jochen Riekhof-3
> Saving the package would overwrite any existing package file so, as you
had
> deleted the class, you would have ended up with a package file that didn't
> contain the class.  It's just the same as deleting a section of a text
file
> and then saving it over the original.

Oh, good that I didn't save!

> If you had saved the package without the class then the best way to
proceed
> would probably have been to restart Dolphin, recover the missing class
from
> the change file, file in the package, add the class back into the package
> and then resave it.
> It's quite difficult (although obviously not impossible) to accidentally
> lose source code in Smalltalk.  The difficulty can be in finding the bits
> you want and putting them back together - it gets easier with practice
> though :-).

Thank you, good tip! I will do some investigation and training on this,
as these kind of things usually happen in high pressure times ;-)..

Ciao

...Jochen