next up previous contents
Next: Configuration File Up: SnapSource: Automatic Snapshots of Previous: Obtaining SnapSource


Installation and Running

  1. Put snapsource and snapview in a one of the directories in your PATH. If necessary, change the permission bit of both files with chmod u+x. Put folder.xpm in the same directory as snapview.
  2. This utility has been tested using Perl/Tk version 800.018. If the widget demo script of this package runs, you should be able to run SnapSource. Otherwise, you might have to set your PERL5LIB to the path where Perl/Tk is installed in your system.
  3. Create directory .snapsource under your home directory
  4. Edit your SnapSource configuration file and copy it to the .snapsource directory created in the previous step.

    cp path-to-config-file/MyProject home-directory/.snapsource

SnapSource consists of two utilities snapsource and snapview.

Running snapsource

Running snapview

The utility snapview is the GUI for browsing through all the delta files created by snapsource. The first screen that you will see after running snapview is shown in Figure 1.

Figure 1: Main window of snapview.

Figure 2: Tree display of a project.

After this point, you can select a project by clicking the down arrow on the pull-down menu to bring up a list of all project configuration files found in the ~/.snapsource directory. After the project name is chosen and the ``Select Project'' button is clicked, a tree display of the selected project will show up (Figure 2). In the current implementation, the tree display does not distinguish between ordinary file and directory. However, if a directory name on the tree display is double clicked, the content of that directory will be shown and the tree display will expanded accordingly. If an ordinary file is double clicked, the delta compare window in Figure 3 will show up.

Figure 3: Comparing base and delta file of a project.

Comparing files maintained by SnapSource can be done in two ways:

This choice can be selected by clicking the radio button on top of the window shown in Figure 3. When ``Base & Delta'' is selected, only one date box will be visible, but when ``Delta & Delta'' is selected, two date boxes will be visible for selecting the snapshot date of the first and second delta files.

The output of comparing delta files (base-delta or delta-delta) will be similar to that shown in Figure 4.

Figure 4: Two-column output of comparing base and delta file

Searching for Delta Files

In an active software development project, its source code will continually changing, and hence a large number of delta files will be produced when SnapSource is used to maintain the project. To facilitate easy selection of delta files, SnapSource provides a ``Search by Date'' facility which can be invoked from the DELTA::SEARCH BY DATE menu. As a result, a window in Figure 5 will show up.

Figure 5: Searching delta files by date

The ``Revision Date'' entry field can be given in three formats: YYYY/MM/DD, YYYY/MM, or YYYY. The most complete format will search for delta files which are produced on a specified date. The least complete format will search for delta files in a specified year.

To speed up changing the date entry, a combination of radio button and push button can be used. The PREV and NEXT will change the date to a less and more recent date, respectively. Figure 6 shows a typical search result.

Figure 6: Search Result

Another facility provided by SnapSource is listing of all delta files. When the DELTA::LIST ALL menu is selected, a window similar to Figure 7 will be shown. Two commands are available on the window: REASSIGN BASE and DELETE DELTA. Both commands work on the selected file from the list. DELETING DELTA is self-explanatory. Further detail description will be given to the REASSIGN BASE command.

For each source file managed by SnapSource, a compressed base file will be created. On each periodic snapshot, a delta file will be created for the source whenever the current content of the source differs from the uncompressed base file. All subsequent delta files will be created based on the difference to this base file.

When a base file is reassigned to a new revision date three things have to be carried out:

  1. A new compressed base file has to be created
  2. All delta prior to the given revision date has to be deleted
  3. All delta after the given revision date has to be updated

This process will be describe formally as follows. Suppose a compressed base file $B$ and $n$ delta files: $D_1, D_2, \ldots , D_n$ are currently maintained, and the base file will be assigned to the revision date of $D_j$'s.

  1. $B_u$ = uncompress ($B$)
  2. $B'$ = patch ($B_u$, $D_j$).
  3. Delete $D_1, D_2, \ldots, D_j$
  4. For $k = j+1, \ldots n$: $D_k$ = diff ($B'$, patch ($B_u$, $D_k$))
  5. $B$ = compress ($B'$)

Figure 7: Listing all delta files

next up previous contents
Next: Configuration File Up: SnapSource: Automatic Snapshots of Previous: Obtaining SnapSource
Hans Dulimarta