View this PageEdit this PageAttachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007

Code Management

You develop code in an image file, but eventually you will want to export code from your image for various reasons. You may want to have a coherent version around. You may want to send some code to a friend. Or you may want to turn in some code for a class.

This page discusses the following ways to export code:
1. Passing around file outs (.st)
2. Packaging in a change set (.cs)

You should also read Collaboration Tools to see about other code-sharing options.


  1. Both .st and .cs files are plain text. When emailing or otherwise exchanging files through a third-party utility (including turning in your code), be sure to zip your files to avoid text manipulation that could corrupt the files.
  2. While we do not recommend passing around old images, it is always a good idea to save many different images as you progress so you can always compare the latest .st or .cs file to what you expected when you filed them out.
  3. If working in a computer lab on campus, always copy your .image and .changes file to the local machine (/temp, not your home directory). The network often goes down as you work, and having this information on your local machine means that you do not have to worry about a network failure corrupting your squeak image. Remember, you can always move them back when you are finished with the current session.

1. Passing around file outs (.st)

This is the most natural method for exchanging your work. In a browser window, simply pull up the context menu and choose to file out whatever is selected. Figure 1 demonstrates a fileOut of the entire "Milestone1" category.

Uploaded Image: fileOutCategory.gif

Figure 1:  File out a category and everything in that category.

Note that you can easily fileout a single class or single method by highlighting them and using the context menus.

The filout will produce an .st file in the directory with your squeak image with the name of the category (or class or method) that you filed out. In this example, we created "". If you want to see the actual code in Squeak that implements this, look at the class "SystemOrganizer" and the method "fileOut".

Now, you need to send your code to your group members.
  1. Zip whatever files you filed out (see warning #1 above).
  2. Email them to your group.
  3. Each member unzips the files, uses a new image with all their work already filed in (see warning #2 above), and then files in your .st files.

To file in code, use the File List utility. You can open a File List from the World menu or from the tools tab on the right hand side of the screen. Figure 2 shows a File List with our file ready to be filed in.

Uploaded Image: fileIn.gif

Figure 2:  File in an .st or .cs file with the File List utility.

The File List is a powerful utility capable of showing you exactly what the contents of a file will do to your image, allowing you to file in only parts you want, or letting you just file in the entire contents (most common case). Note that the file list can also be used to file in .cs files as dicussed below.

The .st format is great for exchanging work because it gives you powerful granularity control over each file out. When turning in your code, however, ALL the graders prefer to file in a single file than to spend time playing with a bunch of .st files. Therefore, we highly recommend using .cs files as a packaging utility for turn-in and as a last-minute sanity check that your code will indeed work on a fresh image.

2. Packaging in a change set (.cs)

Using code change sets (.cs files) is a powerful way to store every change you make to an image. For this class, however, we recommend using them only when you are ready to put all your code in one file for a turnin. Here are the steps we recommend:

  1. Make sure all of your code is filed out somewhere that is easy to find.
  2. Start with a fresh squeak image.
  3. Open a Change Sorter either from the World mene or from the Tools tab on the right-hand side of the screen.
  4. Use the context menu to create a new change set as in figure 3. Note that you should name the change set something that makes sense (like your team name and the milestone and maybe a version) so you will be able to identify the changeset easily later.
    Uploaded Image: newChangeSet.gif
    Figure 3:  Creating a new change set in the Change Sorter

  5. Use the context menu to make all new changes go to your new change set as in figure 4.
    Uploaded Image: changesToMe.gif
    Figure 4:  Make all changes go to the new change set.

  6. File in your code (.st or .cs files) and any other code that is different than the base squeak image (i.e. packages off of SqueakMap). If you download something from SqueakMap, you can use the Dual Change Sorter to make sure all the changes from SqueakMap are included in your change set (move the changes to your set from whatever changeset was installed).
  7. File out the change set using the context menu as in figure 5..
    Uploaded Image: fileOutChangeSet.gif
    Figure 5:  File out your change set.

  8. Now, you have your entire submission in a single file. In this example, that file is "mygroup-M1.1.cs". It is a good idea to save the image from which you filed out the change set in case you forgot anything. Be sure to test (SUnit comes to mind) your change set on another fresh image so that you know it includes all the latest code and everything you need to run the code.
  9. Zip up your change set and attach it to the turnin page for your TA (see warning #1 above).

Links to this Page