Tools: MPW
Advanced Search
Apple Developer Connection
Member Login Log In | Not a Member? Support

MPW Command Reference


CompareRevisions

Script

SYNTAX

CompareRevisions file

DESCRIPTION

The CompareRevisions script compares the revision of file with another revision of that same file. The script automatically determines the file's project and revision number by using the ProjectInfo command. It then displays a list of all other revisions of the file and allows you to choose one for comparison.

CompareRevisions checks out the revision you choose and calls the CompareFiles script to display this revision and file in adjacent windows on the screen and highlights the differences between them. A Compare File window appears below the adjacent windows to display messages produced by the Compare tool. These messages indicate the source of each difference, starting with the last.

The temporary Compare menu, shown below, appears in the menu bar to help you step through the differences.

This menu contains four items for viewing and editing differences:

Find Next Change

Finds the next difference and highlights it in each window. Differences are shown from bottom to top, ensuring that editing changes do not affect the file offsets recorded from Compare.

Copy Selection » »

Replaces the highlighted text in file with that in the other revision.

« « Copy Selection

Replaces the highlighted text in the other revision with that in file.

Done

Closes the files (after asking in a dialog box if you want to save changes) and deletes the Compare menu. If you close any of the windows yourself, CompareFiles does not restore them to their previous size and position.

INPUT

None

OUTPUT

None

ALIAS RESOLUTION

CompareRevisions does not resolve aliases in leaf names. The concept of Finder alias files does not apply within a Projector database.

STATUS

CompareRevisions can return the following status codes:

0

no errors

1

syntax error

2

error in processing

3

system error

4

file not found or revision list missing

PARAMETERS

file

Specifies the revision of the HFS file to be compared with another revision of the same file. Note that you do not need to specify a revision number for file because CompareRevisions automatically determines it with a ProjectInfo command.

Since CompareRevisions also finds other revisions of the same file by determining the project to which it belongs, file must belong to a currently mounted project. If the project to which the file belongs is not currently mounted, CompareRevisions displays a dialog box alerting you that the project is not mounted.

OPTIONS

None

EXAMPLES

The following example compares the revision of file.c in the current directory with any other revision of file.c in the project.

CompareRevisions file.c

SEE ALSO

Compare

CompareFiles

 
 


Last Updated July 2000