Node: Comparing versions, Next: , Previous: Checking out a version, Up: Basic Use



Comparing versions

If you have modified a working file, say main.c, and want to see how it differs from the file from which it was checked out, use

     % prcs diff P1 main.c
     

By specifying versions, you can perform other comparisons. To compare the working version of main.c with that in version 0.1:

     % prcs diff -r0.1 P1 main.c
     

To compare main.c in versions 0.1 and 0.3:

     % prcs diff -r0.1 -r0.3 P1 main.c
     

To compare the working version of main.c with the latest in version 0:

     % prcs diff -r0.@ P1 main.c
     

In place of `main.c', you may use any list of files and directories; each will be compared with files from the indicated versions. Mentioning a directory causes comparison of all files under that directory. Leaving off the file name list (e.g.,

     % prcs diff P1
     % prcs diff -r0.1 P1
     % prcs diff -r0.@ P1
     

) performs the comparison for all files in the project versions.

The output of prcs diff indicates differences between files, and also cases where a file is present in one version (or working version) but not another.

If you have a working version that you have been modifying, you may have added files to it that are not yet reflected in the project descriptor (.prj file). Normally, prcs diff will ignore these files. To get a full comparison, you must first add these additional file names to the working project descriptor (see Adding files to a project). If you don't really intend to add these files immediately, you can save and restore the original working project descriptor:

     % cp P.prj tmp-P.prj
     % prcs populate P
     % prcs diff
      ... output from diff
     % mv tmp-P.prj P.prj
     

or (if you haven't touched the project descriptor since checking it out), you can simply restore the project descriptor:

     % prcs populate P
     % prcs diff
      ... output from diff
     % prcs checkout P P.prj