P4Web Release 2007.3 User Guide
[Getting Started]  [How To...]  [Browser Tips]  [Glossary]  [Road Map]  

Syncing Files

The Perforce sync command is used to synchronize your workspace files with the files in the depot. It uses your client spec to determine which depot files to get and where to put them in your workspace. You can click on your Client name at the top of any screen in P4Web to look at or edit your client spec.

If there are files in the depot that haven't been copied to your workspace, sync will copy them in. If any the depot files have been updated, sync will copy the newer files to your workspace. If you have files in your workspace that have been deleted in the depot, or if you have changed your client mapping so that files you previously synced are no longer in your client view, sync will remove those files from your workspace. If your workspace files are already in sync, the sync command will do nothing.

The "" and "" icons mark workspace files that are in sync with existing and deleted depot files, respectively. The "" icon marks files that are not in sync with head revisions in the depot. If you have "Show entire depot" set, files previously synced but no longer mapped in your client view are marked with "".

If you have files open for edit or integrate, sync will not remove or copy over them. However, you won't be able to submit your open files until you've resolved changes from the newer files in the depot. After you sync open files, they'll be marked with the "" icon to remind you they need to be resolved.

Normally files copied to your workspace by sync are read-only. Use open for edit to make them writable.

There are a couple of ways to run sync in P4Web:

  1. Select Sync... from the pulldown menu at the top of the Files tab. This puts you in a Sync Options page where you can pick options and choose to either preview or run the the sync command.

    Previewing shows you which files will be updated and where they will be written to your workspace.

  2. Use the "Sync to head revision" shortcut button. This operates on the current path or file and syncs to head revisions without offering you any options.

    Sync to Head Revisions "Sync to head revision" shortcut button

The Sync Options Page

The Sync Options page lets you pick from these options before previewing or running the sync command:

Head revision
Sync to the head revisions (latest versions). This is the default option.

Revision number
Sync to a specific, absolute revision. This is probably only useful when syncing one file. Enter a revision number in the space provided.

Changelist Number
Sync to a specific changelist number. Enter the changelist number in the space provided. Syncing to a changelist number gets files that were the head revisions in the depot at the time the changelist was submitted.

Label or Date
Sync to a specific symbolic revision revision (either a label or date). This can be used to synchronize your workspace files to something other than the latest files in the depot. Enter the label or date in the space provided.

Same Revision
Sync to the same revisions you already have in your workspace. (Unless you also check the "Force" option, this results in a sync command that does nothing.)

Force
Gets fresh copies of files from the depot, even if the Perforce server thinks you already have those files. Use this option if you need to replace files that were manually removed from your workspace.

If you came to the Sync Options page with a directory selected, you can restrict the files to be opened. Regardless of which files you select, a file is only synced to your workspace if:


Syncing and submitting from remote machines

P4Web mediates between a Web browser and a Perforce server. You can run P4Web on a machine that is separate from both the browser and server machines. When using P4Web remotely, the important thing to understand is that your workspace resides on the machine where P4Web is running, and not the machine where the browser is running.

P4Web enables you to edit text files directly in your browser, even when P4Web is running on a remote machine. However, to edit binary files on a remote machine, you must sync them, open them for edit, and then download them to your browser machine. To submit edited files from a remote machine, you must upload them to the workspace on the P4Web machine before submitting them.

Downloading and uploading binary files:


Copyright 2007 Perforce Software. All rights reserved.