Perforce 2002.1 P4Win Help in Print
<< Previous Chapter
Configuring P4Win
Table of Contents
Index
Perforce on the Web
Next Chapter >>
Tracking Changes Using Jobs

Chapter 3
Managing Files

Adding files to the depot


To add files to a depot, you add the files to a pending changelist and submit the changelist. Only files that reside in directories in your client view can be added to a depot.

To add files to a changelist:

  1. Choose File>Add to Source Control... The Add File(s) to Source Control dialog is displayed.

  2. Browse to the files you want to add and select them. The Found Files for Add dialog is displayed.

  3. To display a subset of the files listed in the dialog, click the Filter Files... button and use the resulting dialog to narrow down the set of files you want to add, then click the Include or Exclude button to return to the Found Files for Add dialog and display the results.

  4. Choose the changelist in which you want to add the files by selecting the changelist from the Add to Change drop-down list. To create a new numbered changelist for the files you are adding, choose New.

  5. Click Add Files. The selected files are added to the specified changelist. When you submit the changelist, the files are added to the depot.

To add files to a changelist using drag-and-drop:

  1. In Windows Explorer (or a similar browser program), select the files you want to add. These files must reside in a path that is included in the client view of the current client workspace.

  2. Drag the files to the pending changelist. The Open Files for Add or Edit dialog is displayed.

  3. To add new files, click the Open files for add only radio button.

  4. To display a subset of the files listed in the dialog, click the Filter Files... button and use the resulting dialog to narrow down the set of files you want to add, then click the Include or Exclude button to return to the Found Files for Add dialog and display the results.

  5. Choose the changelist in which you want to add the files by selecting the changelist from the Add to Change drop-down list.

  6. Click OK. The selected files are added to the specified changelist. When you submit the changelist, the files are added to the depot.

Changing a file's type


When a file is added to the depot, Perforce assigns it a file type of text or binary.

To change a file type:

  1. Choose View>Changelists>Pending Changelists.

  2. Locate and right-click the file.

  3. Choose Change File Type from the context menu. The Change File Type dialog is displayed.

  4. Select the desired file type options, then click OK.

You cannot change a file's type until after you add it to the depot.

If you enable keyword expansion for a text file, the following RCS keywords are expanded every time the file is submitted:

Editing files


To change files in the depot, you open the files for edit, make changes, then submit the changelist that contains the changed files. Opening files for edit makes the files writable but does not alter the contents of the files in any other way.

To open a file for edit, select the file in the left pane and choose File>Open for Edit, or drag the file to any pending changelist displayed in the right pane.

To open a file for edit and launch its associated editor, select the file in the left pane and choose File>Edit Using...

To prevent other users from submitting changes to a file you have opened for edit, you can lock the file. Other users can open the file for edit but cannot submit their changes until you submit the changelist that contains the file or unlock the file.

To lock a file that is open for edit, right-click the file in the left pane and choose Lock from the context menu.

To discard your changes to the file, right-click the file in the left pane and choose Revert from the context menu. When you revert a file you have changed, P4Win restores the head revision of the file from the depot to your client workspace, overwriting any changes you have made. The file is no longer open for edit.

To close all unchanged files in a changelist, right-click the changelist and choose Revert Unchanged Files. The files are no longer open for edit.

Displaying a file's revision history


Enables you to view any of the selected file's revisions, sync a revision to a client workspace, or compare two revisions of the same file. The number of revisions displayed in this dialog box is specified on the Connection settings tab in the Perforce Options dialog box.

To display a file's revision history, right-click the file and choose Revision History... from the context menu. The revision History dialog is displayed.

You can perform the following tasks in this dialog:

Deleting files


To delete files from the depot, you open the files for delete and then submit the changelist containing the files to be deleted. When you delete files from the depot, previous revisions remain; Perforce creates a new head revision marked "deleted."

To open a file for delete, right-click the file in the left pane and choose Open for Delete from the context menu. The selected file is placed in the default changelist, and is deleted when you submit the changelist.

To recover files deleted from the depot:

  1. Choose View>Show Deleted Depot files to display deleted files.

  2. Right-click the file you want to recover and choose Sync>Sync to Revision, Changelist, Label, or Date...

  3. Specify the revision you want to recover and click OK. (Do not specify the head revision, which is deleted.)

  4. In the left pane, right-click the file you want to restore and choose Recover Deleted File from the context menu.

To delete a file from the client workspace only, right-click the file (in the left pane) that you want to restore and choose Remove From Client from the context menu. To restore the file to the client workspace, sync it.

To preserve the consistency of your client workspace with the depot, do not delete files from your client workspace manually (that is, using Windows Explorer or the DOS del command).

To check for deleted files:

  1. In the left pane, select the files you want to check.

  2. Choose File>Check Consistency. If files stored in the depot have been renamed or manually deleted from the client workspace, P4Win displays a list of files that are inconsistent with the depot.

  3. To open the missing files for delete, click the Open for Edit/Delete radio button and specify the changelist in which you want to include the file. The files are deleted from the depot when you submit the specified changelist.

  4. To restore the missing files to your client workspace, click the Force Resynchonization radio button.

  5. Click OK to execute the selected action.

Copying files to the client workspace


To obtain the latest version of a file in the depot, you sync the head revision. You can sync previous versions by specifying the revision number, a label, a changelist number, or the date.

To copy the head revision of a file to the client workspace, right-click the file in the depot pane and choose Sync>Sync to Head Revision from the context menu.

To copy a previous revision of a file to the client workspace:

  1. In the left pane, right-click the file and choose Sync>Sync to Revision, Label, Changelist, or Date... from the context menu. The Sync to Revision, Label, Changelist, or Date dialog is displayed.

  2. To specify a revision number, click the Revision Number radio button and enter the revision number. To sync to a label, changelist, or date, click the Other radio button and specify the desired label, changelist or date.

To copy a previous revision of a file to the client workspace (alternate method):

  1. In the left pane, right-click the file and choose Revision History... from the context menu. The Revision History dialog is displayed.

  2. In the list of file revisions, click the revision you want to sync.

  3. Click the Sync button. The selected revision is synced to your client workspace.

Comparing client and depot files


You can compare (or "diff") files in your client workspace with files in the depot to determine whether the files differ and whether files have been manually deleted from the client workspace. You can also compare two versions of a file in the depot. You cannot compare files that are open for deletion or addition. To display changes you have made since you synced a file, diff the copy in your client workspace with the head revision in the depot.

To diff client files with depot files:

  1. Right-click the depot file in the left pane. The context menu is displayed.

  2. Choose Diff vs Depot File or Diff vs Head Revision. If the files differ, P4Diff is launched and displays the differences between the client files and depot files. If no differences exist, P4Win displays a message in the output area indicating that the files do not differ.

  3. Choose File>Exit to return to P4Win

To diff two revisions of the same file:

  1. In the left pane, right-click the file you want to check. The context menu is displayed.

  2. Choose Revision History... The Revision History dialog is displayed, listing the revisions of the selected file.

  3. Select the two revisions you want to compare (click the first revision, then CTRL-click the second).

  4. Click the Diff Revs button. P4Win launches the file comparison utility, which displays the differences between the selected revisions.

Displaying changelists


To display pending changelists, do either of the following:

To display submitted changelists, do either of the following:

To view a submitted changelist, double-click it.

In the submitted changelist form, files and users are highlighted. To get more information about highlighted users and files, right-click the user or file and choose the desired operation from the context menu.

To display submitted changelists containing specific files:

  1. Display submitted changelists as described above.

  2. Drag the files (or folders that contain the files) from the left pane to the right pane, or choose Changelist>Filtered Submitted Changelists for Selected Files.

The submitted changelists that contain the files are displayed. If you drag a folder, the changelists displayed contain one of more of the files in the folder.

To display all submitted changelists, choose Changelist>Unfiltered Submitted Changelists.

Working with changelists


To change files in the depot, you submit changelists, which contain details about the change. When you open or integrate a file, the file is added to the default changelist. You can create additional changelists and move files from one changelist to another.

The default changelist is unnumbered until you submit it, at which time Perforce assigns it a number. All other changelists are numbered. Unsubmitted changelists are called pending changelists.

To create a numbered changelist:

  1. Choose Changelist>New... The Perforce Change Specification form is displayed, listing open files.

  2. In the Description field, enter a description indicating the purpose of the change.

  3. In the Files field, check the files you want to be in the list. To clear the check mark from multiple files, select the files and press the space bar.

  4. Optional: if the change affects jobs, select the job status from the JobStatus list.

  5. Click Update to save your changes. Perforce assigns a number to the changelist and displays it.

For details about the fields in the Perforce Change Specification form, click FormInfo.

To edit a changelist, right-click the changelist and choose Edit Spec... If you update the default changelist without submitting it, the changelist is saved as a new numbered changelist.

To move a file from one pending changelist to another, drag the file from the source changelist to the target.

To configure P4Win to omit (uncheck) unchanged files from changelists, choose Settings>Options..., click the Miscellaneous tab, and check Automatically deselect unchanged files before changelist submission.

To submit a changelist:

  1. Right-click the changelist and choose Submit from the context menu. The Perforce Change Specification dialog is displayed.

  2. Enter a description and optionally deselect files to be submitted.

  3. Click Submit to send your changes to the depot.

If there are file conflicts, Perforce requires you to resolve them before you can submit your changes. See "Resolving files" on page 42.

When you submit a changelist, you can reopen the files immediately after you submit them by checking the Reopen box on the Perforce Submit Specification form. To configure the default setting for this option, choose Settings>Options, click the Miscellaneous tab, and enable or disable Default setting for Reopen files flag when a changelist is submitted.

To delete a changelist, right-click the changelist and choose Delete Empty Changelist. You cannot delete a changelist unless it contains no files and has not been submitted.

To locate changelists submitted by a client or user (three ways):

Resolving files


File conflicts can occur when a user attempts to integrate a file or to submit a changelist containing a file that another user has edited. When the conflict occurs, Perforce schedules the file for resolve. Conflicts must be resolved before the changelist that contains the conflicting file can be successfully submitted.

The files you work with when resolving are described in Perforce as follows:

To resolve files manually:

  1. Click the file and choose File>Resolve>Interactively. The Resolve File (3-way merge) dialog is displayed.

  2. Select the file you want to submit, or use the merge utility to compare the two file versions with their common ancestor. The merge utility enables you to select specific passages or edit the results to create a merged version of the file.

  3. To edit Your file, click the Edit button under the file name.

  4. To select the file you want to submit to the depot, click the corresponding button, as follows:

To resolve files automatically:

  1. Click the file and choose File>Resolve> Auto-Resolve.... The Auto-Resolve dialog is displayed.

  2. Click the Resolve Type radio button that specifies how you want to resolve the files, as follows:

    Option
    Description

    Accept Theirs

    Accept their file as the head revision of the file. Note that this option overwrites your file on the client workspace.

    Accept Yours

    Accept your file as the most current version of the file.

    Safe Automatic Resolve

    If either your file, or their file (but not both files) are different from the base file, accept the differing version of the file as the head revision. If both files are different from base file, do not perform a resolve on this file.

    Automatic Resolve

    If their file is identical to the base file, accept your file as the head revision. If your file is identical to the base file, accept their file as the head revision. If your file and their file are both different from the base file, but there are no conflicts between yours and their file, accept a merge of the two files as the head revision. Otherwise, if there are conflicts between your file and their file, do not perform resolve on this file.

    Automatic Resolve, Including Conflict Markers

    Accept the merged file as the head revision regardless of the status of yours and their files. If conflicts are found in the two file versions, the conflicts are marked and retained. The file must then be edited manually to eliminate the conflicts.

  3. Click OK to perform the resolve.

To manually schedule a file for resolve:

  1. Display the changelist that contains the file.

  2. In the changelist's file list, right-click the file and choose File>Resolve>Schedule for Resolve from the context menu.

You need to schedule resolve manually only if you have a file open at a previous (non-head) revision. When you schedule resolve manually, files are reopened at their head revision.


Perforce 2002.1 P4Win Help in Print
<< Previous Chapter
Configuring P4Win
Table of Contents
Index
Perforce on the Web
Next Chapter >>
Tracking Changes Using Jobs
Please send comments and questions about this manual to [email protected].
Copyright 2001-2002 Perforce Software. All rights reserved.
Last updated: 04/03/02