C4(1) C4(1) NNAAMMEE c4 -- CVS like front end to the Perforce SCM system SSYYNNOOPPSSIISS cc44 _p_4_-_c_o_m_m_a_n_d ... cc44 uuppddaattee||ssccaann||iimmppoorrtt [ --aaccddnnvvxxDD ] DDEESSCCRRIIPPTTIIOONN CC44 provides a CVS like _f_e_e_l to Perforce's SCM system pp44. CC44 is not a substitute for CVS, in that it does not try to mimic CVS's command set. Like CVS, every file in a user's work-space (_c_l_i_e_n_t) is writable, and can be modified on an ad hoc basis. CC44 pro- vides commands that search a client, looking for files that have been changed, and runs a "_p_4 _e_d_i_t" command on them. Any files that are currently opened for edit, and are no longer different than their repository (_d_e_p_o_t) ver- sion, a "_p_4 _r_e_v_e_r_t" command is run on them. Files that are missing from the client are refreshed ("_p_4 _r_e_f_r_e_s_h"). Files that exist in the client that have no matching depot version are reported, to remind the user to add them, and can optionally be added automatically. Files that are out of date with respect to the depot are updated ("_p_4 _g_e_t"). CC44 also provides support for clients without the use of environment variables. Each time cc44 is executed, it searches for a "..cc44" file, and incorporates its contents into the environment of any _p_4 command that it invokes. The "..cc44" file is usually kept in the root directory of a client. CC44 should be used with Perforce version 97.3 or later. CC44 will work with older versions, but files will not remain writable, reducing the usefulness of cc44. CCLLIIEENNTT CCRREEAATTIIOONN Making a new client for use with cc44 is slightly different than when using pp44 directly. Here are the steps that should be followed: 1. Create a client directory. 2. Create a file called "..cc44" in the client directory with the following contents: P4PORT=_<_p_4 _s_e_r_v_e_r _p_o_r_t _a_d_d_r_e_s_s_> P4CLIENT=_<_c_l_i_e_n_t _n_a_m_e_> 3. Change directory to the client directory, and run the command "cc44 cclliieenntt" to create the Perforce client. Set up the client as usual. Modify the "OOppttiioonnss" line to enable "cclloobbbbeerr" and add the option "aallllwwrriittee". For example: Options: nomodtime clobber allwrite 4. Populate the client with the command "cc44 uuppddaattee". Note that "cc44 uuppddaattee" should be used in preference to "cc44 ggeett"; with the _c_l_o_b_b_e_r flag set, a modified file may be overwritten, destroying any changes made to it locally. CCOOMMMMAANNDDSS If cc44 doesn't recognize a command, it just passes the com- mand and the remaining arguments to pp44, after incorporat- ing the contents of the "..cc44" file into the environment. If cc44 recognizes the command, it is executed locally, usu- ally invoking several pp44 commands. CC44 adds three new com- mands: cc44 uuppddaattee "cc44 uuppddaattee" resembles the CVS _u_p_d_a_t_e command. It per- forms the following actions: 1. Recursively scan the current directory and any sub- directories, gathering information about files, in- cluding whether the file has been modified with re- spect to its depot version. 2. Report any files that are unknown, to remind the us- er that they should be added. This step can be omitted with the --xx option. Files which are _i_g_n_o_r_e_d are not reported (see the section "IGNORING FILES" below). 3. Files that are not opened and are different than their respective depot versions are opened with a "pp44 eeddiitt" command. Files that are opened and are now the same as their respective depot version are reverted with a "pp44 rreevveerrtt" command. Files that are missing from the client are refreshed with a "pp44 rree-- ffrreesshh" command. 4. Files that are out of date with respect to the depot are retrieved with the command "pp44 ggeett". Note that a "cc44 uuppddaattee" can never overwrite a file be- cause a modified file is always opened for edit with a "pp44 eeddiitt" command before it is retrieved with a "pp44 ggeett" command. If a modified file is out of date, then the user will need to resolve the differences with a "cc44 rreessoollvvee" command before submitting. cc44 ssccaann "cc44 ssccaann" is the same as a "cc44 uuppddaattee, but it does not update out of date files ("pp44 ggeett"). cc44 iimmppoorrtt "cc44 iimmppoorrtt" is used to import or re-import whole source trees into Perforce. CC44 will figure out all changes that have happened in the source tree and issue "pp44 aadddd", "pp44 eeddiitt" and "pp44 ddeelleettee" commands as appro- priate. Apart from files that are added, modified or deleted, cc44 can also handle files that have changed type -- a file that was a regular file that is now a directory or symbolic link, or any other combination of change. The general procedure for import is: 1. Make sure that the tree is up-to-date by doing a "cc44 uuppddaattee" or a "cc44 ssyynncc ......". This is obviously not necessary if this is a new tree. 2. Replace the tree with the new tree. This almost al- ways means that you should remove the old tree and copy in the new tree, ensuring that files that no longer exist get deleted. 3. Change directory to the root of the tree and run "cc44 iimmppoorrtt". This will issue add, edit and delete operations as appropriate. 4. Submit the resulting changes ("cc44 ssuubbmmiitt"). Import can be used when moving source from another source control system to Perforce. A lump of source that can be identified as a single change is extracted from the other source control system and submitted us- ing the above procedure. The date of the change can even be set correctly by using the "pp44 cchhaannggee --ff" com- mand after the submit. ..CC44 FFIILLEE FFOORRMMAATT Each time cc44 is executed, it searches for a "..cc44" file, and incorporates its contents into the environment of any _p_4 command that it invokes. The "..cc44" file is usually kept in the root directory of a client. If a "..cc44" file is not found, then the correct pp44 environment variables must be set (usually PP44PPOORRTT and PP44CCLLIIEENNTT). Every line that begins with an alphabetic character (`A' - `Z' or `a' - `z'), and contains an `==' is added to the en- vironment. Every line that begins with a `::' is used as an ignore specification (see the section "IGNORING FILES" below). Every line that starts with a `##' character, is empty, or contains only spaces is ignored. All other lines are currently ignored, but may not be in future ver- sions of cc44. IIGGNNOORRIINNGG FFIILLEESS While scanning, if files are found that are not known to the depot, they are examined to see if they should be ig- nored. This is done by matching the basename (the last name component) of the file to the ignore list for the current directory and the global ignore list. The ignore list for each directory is stored in a file called "..cc44iigg-- nnoorree" in that directory. The global ignore list is com- piled into cc44, and can be modified or replaced by entries in the ..cc44 file. Directories are matched with ignore lists, allowing whole directories to be ignored. Lines beginning with `::' in the ..cc44 file are considered ignore specifications. An ignore specification is a glob- bing string as used by the shell; a file will be ignored if it matches any entry in an ignore list. A `::' on a line by itself will cause the entire ignore list to be deleted; this is generally used to clear the global list and replace it with new entries. The default compiled in global ignore list contains the following: *.o, *.a, *.Z, *.gz, .c4, tags, TAGS, core. Here is an example ..cc44 file that defines typical environ- ment variables and replaces the builtin ignore list with another: P4PORT=bigsun:1666 P4CLIENT=myclient : :*.bz2 :*.[is] :x.* :core PPEERRFFOORRCCEE SSUUPPPPOORRTT CC44 uses two as yet undocumented features included in 97.3 and later releases of pp44: allwrite The _a_l_l_w_r_i_t_e client option always creates files that are writable in the client. While cc44 does not rely on this, much of its usefulness is diminished without it. diff -sc "cc44 ddiiffff --sscc" combines the effect of "cc44 ddiiffff --ssaa" and "cc44 ddiiffff --ssee", to improve the performance of scanning for changed files. CC44 will only use this feature on versions 97.3 and later. [Note: In the 97.3 release, this feature did not work correctly, so cc44 does not use it. It was later discovered that this feature would not significantly increase the performance of cc44.] IINNSSTTAALLLLAATTIIOONN CC44 is a single executable that is usually stored in the same place as the pp44 client executable. CC44 may be config- ured as a replacement front end for pp44 by creating a shell script called pp44, which contains the following: #!/bin/sh export P4COMMAND=_<_n_a_m_e _o_f _r_e_a_l _p_4 _c_o_m_m_a_n_d_> c4 "$@" OOPPTTIIOONNSS When one of the local cc44 commands is invoked, the follow- ing options may be used to modify its behavior: -a Force automatic add. When used with "cc44 uuppddaattee" or "cc44 ssccaann", unknown files will be added rather than just reported. -c Canonical update processing. CC44 will run commands necessary to change the depot to reflect the current client, regardless of the changes. [Depreciated; use "cc44 iimmppoorrtt".] -d Force automatic delete. When a file is missing in the client, it will be deleted from the depot, rather than refreshed. -n Any commands that cause changes will not be executed. When cc44 is invoked with the -n and -d options, the us- er can see what will be executed for a given circum- stance. -v Verbose. Print more messages about what is happening. This is useful when running cc44 at the root of a large client directory structure; it will print the name of each directory as it is scanned. -x Messages about unknown files usually reported by "cc44 uuppddaattee" and "cc44 ssccaann" are suppressed. -D When given, cc44 prints diagnostic messages about what is going on (used for debugging cc44). Multiple -D op- tions can be given to get more details. SSEEEE AALLSSOO p4(1), "Perforce User Manual". BBUUGGSS If you modify a file locally that has been changed in the depot, then when you do a "cc44 uuppddaattee", you will get a merge conflict. CC44 runs a "pp44 eeddiitt" command followed by a "pp44 ggeett" command on the file, which will result in mes- sages that may confuse some users; cc44 does the right thing though. You will have to run a "cc44 rreessoollvvee" to deal with the merge issues before you can submit the file. Do not run "cc44 ssyynncc" or "cc44 ggeett" as the messages suggest. With both "cclloobbbbeerr" and "aallllwwrriittee" options set on the client (as they should be when using cc44), you should not use "cc44 ggeett" to update files from the depot if you have made local changes -- your changes will be overwritten. Use "cc44 uuppddaattee". If you run cc44 in a directory that is empty in the depot, such as a directory with only new files in it, you may see messages like "... - no such file(s)". Don't worry about them. When doing a "cc44 iimmppoorrtt", the client must be up-to-date with respect to the depot before changes are made to the client; that is, there must not be files that must be syn- chronized in a directory that no longer exists. This is because the pp44 client command does not handle directories; if a directory is replaced by a file or a symbolic link, pp44 can get confused and cc44's import processing will fail. When doing a "cc44 iimmppoorrtt", changes between a regular file, directory or symbolic link are handled, however, this functionality is not well tested. This will no doubt be taken care of by the next release of cc44. The options provided by cc44 are not necessarily consistent with each other. This is a historical accident and may be rectified in the future. 1.6 C4(1)